| User | Post |
|
22:22 15. February 2011
| herb
| | |
| Member | posts 4 |
|
|
Hoping someone could help me… I have the world server and login server up. I built a little app to emulate a connection (using the stock WSE for starters). After I connect to the world, I'm always disconnected after about 5 seconds and I just can't seem to figure out why! Even the example winforms game client did the same thing (after I fixed a few things to get it to compile). I'm just calling:
Connection = new WorldConnection(host, port, "0.1");
Connection.AccountId = 2;
Connection.WorldMessageReceived += new WorldClientMsgEvent(Connection_WorldMessageReceived);
Connection.CharManagementMessageReceived += new WorldClientMsgEvent(Connection_CharManagementMessageReceived);
Connection.StateChanged += new WorldConnection.StateChangeHandler(Connection_StateChanged);
bool result = Connection.ConnectToWorld("admin_test_key");
Everything connects fine and I get the a connected state message and even the character list message and then I get a disconnected state message. I just can't figure out why… I would like to use this package for my game, but I'll be forced to leave it if I can't get a simple client to stay logged in. Let me know if anyone has any ideas. Thanks!
|
|
|
20:15 16. February 2011
| herb
| | |
| Member | posts 4 |
|
|
For some more info, it's really only a second or two (not 5). In the server I can see the "NotifyDisconnect" method in ClientStateManager.cs is fired. The comments above the method say that a physical connection to the connection is lost, but I never disconnect the client… Not sure what's going on…
|
|
|
18:16 18. February 2011
| herb
| | |
| Member | posts 4 |
|
|
Alright, seems like this project just might not be active anymore… In my last attempt, I downloaded the latest Lidgren source and compiled the Borg against the Lidgren debug build. This got me one more piece of info. Lidgren outputted the disconnection of the client on the server was due to a client timeout. The only information I could find on that timeout was to make sure the Lidgren connection object (on the server) approve method is called, which I did find in the Borg source. So, again, I'm not sure what's going on. I can connect my client to the Borg Login Server and not get disconnected, but not the world server.
|
|
|
09:54 24. February 2011
| GambitRicky
| | |
| Member | posts 29 |
|
|
herb said:
Alright, seems like this project just might not be active anymore… In my last attempt, I downloaded the latest Lidgren source and compiled the Borg against the Lidgren debug build. This got me one more piece of info…. CUT …
I am sorry not to be able to respond on time but I am in a middle of a huge software rollout and have hardly time to read my mails 
As you noticed the Borg Server project is a bit on hold due to many reasons. One of those is that the server framework is actually production ready and even used in some products! Of course there are and always will be missing features (like chat rooms/teams/groups etc) but those are trivial to implement in a WSE. I simply don't have the time, and most formerly active developers are in a similar situation.
Back to your question.
You gave too little info/logging messages to conclude whats going on, but if the client closes the connection there is nothing the server can do. There are many reasons a client will close the connection (get timeouted) one of them is stepping through code in the debugger!
Please do a SVN update, start the world server and start the trunkSourceBorg Demo GameMages & Mercenaries.sln (this must be VS 2008 since its XNA based). I just checked it and it works as expected!
Note that you cant change the lidgren library versions thats why a SVN update or fresh checkout is mandatory.
You are mentioning a Winform client but we do not have any active Winform clients…there is one very old and outdated GameClient project but this probably want even compile. I know that this should have been documented but its an old test client forgotten from everyone which should not even be there…
Please use the M&M game for testing!
Also check the WorldState class in M&M. This class inherits the WorldConnection because a XNA game cant have Forms like a Winform client and must handle the game state manually. Its a bit coupled with TXNA objects but you can easy follow the source and even reuse it if commenting out all the TXNA objects.
If you are willing to get your hands dirty you are more than welcome to update the GameClient and I will help you as far as my time allows it.
|
|
|
15:28 24. February 2011
| herb
| | |
| Member | posts 4 |
|
|
Thanks GambitRicky. Looks like I'm doing a few bads things (using an outdated winforms app and the wrong version of Lidgren). I'll do some digging. I was trying to avoid configuring XNA to get a basic test going, but sounds like that might just be the best thing to do. Thanks again.
|
|
|
15:55 24. February 2011
| GambitRicky
| | |
| Member | posts 29 |
|
|
If you really want to run the M&M game you must install Xna 3.1 and get the TXna project from SF. Just make the checkout side by side with borg and it will work fine.
But you don't have to do that. I was just saying that M&M works 100% and you could use the source code to get a idea what to do.
Anyway seems your initial approach should work as well (instancing a WorldConnection object and let it handle all the character retrieval and state change events) I see no reason it would not work…
|
|
|
12:12 11. March 2011
| Critical_Impact
| | |
| Member | posts 3 |
|
|
I've had a go at getting the GameClient working, I've been able to get the client connected, player creation is working, movement works using the text box. I think having a sample of some of the basics is always good, so once I've updated some more I'll upload it to the SVN if I'm allowed :D
I've noticed through out it that it says
"Note that this implementation is WSE and test client specific (cannot be used in production code)"
Instead of sending the characters as text would you be serialising them or what would change to make it production code?
|
|
|
12:44 11. March 2011
| GambitRicky
| | |
| Member | posts 29 |
|
|
Post edited 12:46 – 11. March 2011 by GambitRicky
Hi,
you can either create a SVN patch and send it or if you plan to commit more stuff I can add you as a member with full SVN access.
And yes there needs to be examples how to accomplish the basics or at least a Hello World demo…but all those basic examples where on the forum and now they are gone for good after a DB backup revert due a Source Forge data loss.
I have no time to deal with it right now.
Regarding your question about demo vs production code…well the point is that Borg can not provide out of the box character data serialization since it does not know what data a game needs and how this data should be formatted.
A game designer must decide what data is needed for a character (level, exp, name, nick, credits, class…etc).
So this a task for the WSE to implement and as well the client side application.
Check the ICharacterManager interface and also in \\trunk\\Source\\Servers\\WorldExtension\\Mandatory\\CharacterManager.cs this is actually the M&M games WSE. It is rather simple but still a good starting point.
|
|
|
16:07 11. March 2011
| Critical_Impact
| | |
| Member | posts 3 |
|
|
Another quick question, I see the Chat is to be handled in LowPriorityManager.
I've found it to be limiting compared to anything done in the Server Extension, but I can understand that chat is not as important for speed so you've put them in their own section along with the server queue and character manager.
I guess my question is, what's the best way to send messages to everyone, I've got it working on mine, but I've sorted of hacked around.
Here's what I did,
Sent a message from the client with the messagetype C2S_PlayerChat, Action=ChatMessage
*Gets a bit funky from here*
I created a function that returns all the ActiveIds through the Mpt,
I then get the sender of each Mpt, create a message, and then add that message to the WorldMessageQueue.
That way it gets sent to everyone. Ideally, I'd like to be able to filter who gets what messages, but for the moment I've done it this way.
|
|
|
17:01 11. March 2011
| GambitRicky
| | |
| Member | posts 29 |
|
|
Just for the record, I was pondering a lot whether the chat makes sense at all in the scope of the server or not. There are so many things a game designer might want to have different than what we eventually implement in the server…
A basic design is prepared (but not yet implemented) where the Server would have a concept of channels (or chatrooms). A small range of chat channels is reserved for admin messages, system messages, operators etc. The remaining channel numbers are application defined. The server would check the desired channel, validate it and send to all clients "subscribed" to this channel.
The plan was to implement server side handling of reserved channels but only pass through other chat messages to the WSE.
Regarding the question how to do it…seems you got that pretty well under control.-)
Check the ClientToServerMessage.cs there should be some basic descriptions (comments) what to send. Also the server side HandleChat() function is empty and needs to be implemented – as far as I remember.
The WSE should be able to attach a collection of channels a player is listening to.
An ordinary game would have at least: global chat, alliance chat, team chat.
There is already a concept of teams (dynamic & not persistent) and memberships (more static but changeable & persisted to the DB). You could check how those are loaded/saved and implement the same for chat channels!
HTH
Riki
|
|
|
18:19 11. March 2011
| Critical_Impact
| | |
| Member | posts 3 |
|
|
Thanks for the quick replies,
I'm well on my way to implementing a better chat system now.
Not sure if my changes would work on the SVN though, mainly because I've now modified Character to have a set of allowed channels they are allowed to communicate on.
That said, I'll probably make some tutorials and samples at some point once I get more of a handle on it.
|
|
|
12:18 13. March 2011
| GambitRicky
| | |
| Member | posts 29 |
|
|
I added some very minimalistic chat handling in the HandleChat() as a preparation for server side chat implementation.
Due to RpgProcessor interface changes the WSE must implement a ProcessChatMessage().
The function can be left empty if no chat functionality is needed.
All chat messages using the private or ApplicationDefined channel (see ChatChannels enum) are simply passed through the WSE via the new ProcessChatMessage().
It would be awesome if you find some time and take a look at the Character class and how Teams/Groups are handled and add same functionality for chat channels. I suppose you already have something like that in place, so if you dont mind sharing just send a SVN patch or I can add you to the team and give full SVN access.
HTH
Riki
|
|
|
12:04 13. July 2011
| Wolven
| | |
| New Member | posts 1 |
|
|
Hello,
I have the same issue with the client disconnecting after a few seconds, so @herb: How did you solve this?
|
|
|
15:11 13. July 2011
| GambitRicky
| | |
| Member | posts 29 |
|
|
Wolven said:
Hello,
I have the same issue with the client disconnecting after a few seconds, so @herb: How did you solve this?
Can you describe the environment? Was it the M&M game client disconnecting or did you wrote your own client and get the disconnects?
Note that Lidgren is not working well in a debug environment – if you place a breakpoint and stop the server/client the other side will get disconnected.
Anyway it should be fairly easy to figure out where the disconnect is originating from. Note that the server can disconnect clients for many reasons (invalid client action request, unexpected message type, protocol error etc.) but the process eventually goes through the MasterPlayerTable.Disconnect() function which logs the reason and also sends the reason string to the client.
So configure the server to run at debuglevel INFO and check the log file first!
|
|
|
15:17 20. July 2011
| puck2304
| | |
| Member | posts 4 |
|
|
I have the same problem. The client disconnects after 5 secondes.
I use Mage & Mercenary client.
Here is a small part of the output where the client connect to the server
2011-07-19 20:55:22,203 [NetworkServer0] [INFO ] [WorldServer.NetworkServer] – Client: 127.0.0.1:1039, new status: RespondedConnect.
2011-07-19 20:55:22,218 [NetworkServer0] [INFO ] [WorldServer.NetworkServer] – Client: 127.0.0.1:1039, new status: Connected.
2011-07-19 20:55:22,718 [MsgHandler0] [INFO ] [WorldServer.MessageHandler] – Deserialized message: C2S_Authenticate->0 from: 127.0.0.1:1039
2011-07-19 20:55:22,718 [MsgHandler0] [INFO ] [PlayerCache.MasterPlayerTable] – Authenticate() Valid secret: 'admin_test_key' received from player: 2, endpoint: 127.0.0.1
2011-07-19 20:55:22,718 [MsgSender0] [INFO ] [WorldServer.MessageSender] – Turn -1: Sent message: S2C_CharacterList to 127.0.0.1:1039
2011-07-19 20:55:25,703 [MsgHandler0] [INFO ] [WorldServer.MessageHandler] – Deserialized message: C2S_StartCharacter->0 from: 127.0.0.1:1039
2011-07-19 20:55:25,718 [20 ] [INFO ] [Server_Extension.RpgRules] – StartCharacter: 'NewName' (1), zone: 0 (0)
2011-07-19 20:55:25,718 [MsgSender0] [INFO ] [WorldServer.MessageSender] – Turn -1: Sent message: S2C_StartSuccess to 127.0.0.1:1039
2011-07-19 20:55:25,734 [MsgSender0] [INFO ] [WorldServer.MessageSender] – Turn -1: Sent ZoneMessage (AddZone) to NewName -> Zones: 1:5:6:0:
2011-07-19 20:55:28,234 [NetworkServer0] [INFO ] [WorldServer.NetworkServer] – Client: 127.0.0.1:1039 disconnected!
In this, I select a character and try to enter in the game but for no reason, the server disconnect the client.
I dont change anyting in the code.
I would like to have a little help in this one.
Thanks
|
|
|
15:55 20. July 2011
| GambitRicky
| | |
| Member | posts 29 |
|
|
OK from the log file it is clear that the server is not disconnecting the client but the client itself gets disconnected.
I just tried out this on a brand new laptop and everything works as expected!!!
My environment:
MS SQL Server express, executed the MS SQL world server script and adjusted WSE path
XNA 3.1 installed
TXna rev 863
Borg Server rev 1164
VS Studio 2010 running the "BorgWorldServer.2010.sln" with the project "BorgWorldServer.2010" set as startup and x86 set as active configuration
VS Studio 2008 running the "Mages & Mercenaries.sln" with the project "GameClient_XNA" set as startup and x86 as active configuration.
I first start the VS 2010 BorgWorldServer and after that the VS 2008 M&M game client.
The client connects to the server, I can pickup a character and start it, move around, change zones pick items from ground etc.
NOTE that if you start everything inside one solution or set some breakpoints inside the client/server, chances are that Lidgren network threads will get stalled. A mix of x86/x64 modes seems to cause some problems on certain configurations as well.
I am sorry but I cant reproduce the disconnecting behavior on any of my dev or test machines. Maybe you should use the lidgren debug version and turn on all Lidgren notifications to see whay your client gets disconnected. You can also check the WorldClientBase.cs line 436 and set a breakpoint there to test why the client is disconnected.
HTH
Riki
|
|
|
15:28 22. July 2011
| puck2304
| | |
| Member | posts 4 |
|
|
I have an issue with the problem of disconnection after 5 seconds. I found the problem.
It's with mysql. It seems it is not fully compatible with the client/server. It connect but after a while disconnect(not very long time). But I test with ms sql like the configuration of GambitRicky and it work very well. Thank to you for sharing your configuration. It was my last attempt to copy your config and now I can work on the client.
|
|
|
15:39 22. July 2011
| GambitRicky
| | |
| Member | posts 29 |
|
|
I would be surprised that MySQL is causing any problems as skyflash was developing on a MySql configuration, also it is hard to imagine a server side sql server causing disconnects on the client side… anyway glad you got it working now!
|
|