Few Basic Questions!!! Help me!!!

locus84
edited October 2011 in Photon Server
Hello, Photon developers and users!

I'm the game designer working in a game company as a balance designer.
My hoppy is making game with tools easy to deal with.(cuz I'm not a programmer myself)
A month ago, I decided to make a server for matchmaking and authorized game logic for my game.
I floated among lots of server engine like smartfox, uLink and tried them. but faild.
Finally I found Photon looks pretty fit my simple games. And I've got some queryes during working with it.

I did my best to solve it myself, cuz I know these are very simple and basic questions and thought I can find it via searching form and documantations in offical Photon webpages.
But there were Obstacles. One is I'm not a programmer as i said above, another is my first language isnt English(mainly this).

So I made up my mind to ask you guys directly about my questions.



1. basic understanings
My base application is LiteLobby. what I understanded by documents about server-client communication is like below.
let me know if I'm wrong.
basicunderstading.jpg

2. how to make logs?
like unity3d's Debug.Log(), how I can ensure my logic is working properly by making some logs in server?

3. where should I implement my own game logic?
I want to make and store some character classes when a player joined a LiteLobbyGame.
Where Should i place it(would be chatacterlist<character>)?? LiteLobbyGame?

4. method which i can refer ActorNumbers?
I understood an actorNumber means a peer that is in my gameroom.
so if a player joins, an actornumber is created and send to whole clients in the room.
the question is, similar to question number 3, if i wanna make mutliple characters per a player,
can i find a peer, or an actorNumber by using Dictionary<actornumber,characterlist>?

so that i can make characters with the player's acternumber when a player is loggin in,
and if a player puts request to change his character, i can findout which character should i modify.

5. game logic in intervals.
In documentation page, I found some codes about it.
And to use these interval functions in my litelobbyGame, I duplicated the codes from litelobbyroom to litelobbygame and modified like this.
It seems it's not working. Cant understand why...
private void SchedulePublishChanges()
{
	var message = new RoomMessage((byte)LobbyMessageCode.PublishChangeList);
	this.schedule = this.ScheduleMessage(message, 50); //declared this property in the property region.&#91;/color&#93;
}

/// Initializes a new instance of the LiteLobbyRoom class.
public LiteLobbyGame(string lobbyName)
	: base(lobbyName) //changed  to litelobbygame
{
	this.roomList = new Hashtable(); //erased cuz I wanna change values according to my game logic only.
	this.changedRoomList = new Hashtable(); //erased cuz I wanna change values according to my game logic only.

	// schedule sending the change list
	this.SchedulePublishChanges();
}

/// Sends the change list to all users in the lobby and then clears it.
private void PublishChangeList()
{
	//do something in intervals...
	this.myGameLogic.Update(50); //there comes my game logic.

	//schedule the next call!
	this.SchedulePublishChanges();
}


5. A more, to attatch mysql into my server.
I found about this myself. and that is NHibernate. It's my firstime to deal with database.
Where I can find proper tutorials about A~Z of setting up a database with basic functions?

Comments

  • Question no.2 has solved!!!
    refered below!!

    1. Just open log4net.config and changed root debug level from INFO to DEBUG!
    2. Set Console appender there!!

    viewtopic.php?f=5&t=37&p=192&hilit=debug#p192
  • Question No5 has solved!

    the documentation of extending lite, i've found scheduledmassage, and cuz i want to make my own interval only in GameRoom,
    I added codes below to my LiteLobbyGame.cs

    Btw, I already solved 2 of my whole questions, That's encouraging!!

    #region InGameLogicInterval
    
    
            protected override void ProcessMessage(IMessage message)
            {
                // this switch only handles the Lobby-specific messages.
                // all other messages will be handled by the base class.
                if ((LobbyMessageCode)message.Action == LobbyMessageCode.InGameInterval)
                    this.GameLogicInterval();
            }
    
    
            private void GameLogicInterval()
            {
                Log.DebugFormat("InGameInterval");
                this.SetNextInterval();
            }
    
            /// &lt;summary&gt;
            /// Schedules a broadcast of all changes.
            /// &lt;/summary&gt;
            private void SetNextInterval()
            {
                var message = new RoomMessage((byte)LobbyMessageCode.InGameInterval);
                if(base.Actors.Count == 2)
                    this.schedule = this.ScheduleMessage(message, 10);
            }
            #endregion
    
  • Sorry for the late reply. Been busy days.

    1. You're right. The "response only" case is rare but not impossible.
    3. LiteLobbyGame, yes. It's a Room and those are the most general "container" for anything that players can access concurrently. A Peer could handle operations that are pre-player only and don't affect anything else (directly.)
    4. Characterlist? What does it do? The actorNr is valid only in-room and changes when you change rooms. You need to add a authentication operation to the peer to fetch stuff for a player (from memory or DB). Once that is available in a room, you can use the actorNr as temporary ID for a player in this room.
    5. You got only a part from the LiteLobbyRoom there. You schedule a message but don't handle it. Also, the message is PublishChangeList, which is not really the message you want to send. Look up where PublishChangeList() is called, then it gets clear.
    6. Proper database tutorials are found throughout the internet. There is not just one page to read, so I can't really be more specific. Use http://www.stackoverflow.com to find tutorials or help on specific questions. Its a great resource!
  • Thank you for reply, Tobias, that's really helping!
    3. So I'm right! Then If I want to implement log in function with Database, because it suppose to be with a client's peer.Connect(); request, should I handle it in LiteLobbyPeer of serverside? Where I can find the place which handles client's connect request and allowing server connecting?
    4. In my game, a player have more than a character. So I need a characterlist per a player, and will place it into LiteLobbyPeer. If a game started, the LiteLobbyGame's interval function will modify them with proper game logic.
    5. Yes, yes! Now I understood! thank you again!
    6. I found a nice tutorial for beginners via that site! Ironically it is documentaions of MySQL homepage. Should have hang around myself, thank you!
  • 3. Let them connect and flag the Peer (server side) as "unauthorized" until a Authorize operation is called by the client and checked by the server. Authorize is an operation you would have to implement. The Loadbalancing application has one which could be a blueprint.

    You're welcome :)