3.5/3.7 Chat Server Help

Results 1 to 13 of 13
  1. #1
    Apprentice whiteone is offline
    MemberRank
    Sep 2011 Join Date
    15Posts

    3.5/3.7 Chat Server Help

    Was wondering if anyone might have some idea's as to why my chat servers seem's to be in a authentication loop. Been messing with it for a few days and no luck I've added some logging on the chat server side and here is what i'm getting.

    Game Server Console
    Code:
    02:16:12.627 INFO [pool-3-thread-6]: - Connected to ChatServer!
    02:16:12.657 INFO [pool-4-thread-3]: - GameServer authed successfully IP : 192.168.1.100 Port: 10241
    
    I've also tried localhost and 127.0.0.1 it connects fine but still the same results

    Chat Server Console
    Code:
    INFO [04 Apr 02:28:02,405] Player registered from server side 98964
    INFO [04 Apr 02:28:02,405] SM_PLAYER_AUTH_RESPONSE opcode and token
    INFO [04 Apr 02:28:16,662] Player registered from server side 98964
    INFO [04 Apr 02:28:16,663] SM_PLAYER_AUTH_RESPONSE opcode and token
    WARN [04 Apr 02:28:29,516] Received logout event without client authentication for player 98964
    INFO [04 Apr 02:28:29,517] Player logout 98964
    
    Repeats every 10 seconds minus the logout

    Packet Samurai
    Code:
    144	+9707 ms	10	CM_CHAT_AUTH
    1E6	+9707 ms	52	SM_CHAT_INIT
    
    Repeats every 10 seconds and the packet structs look right.

    As you can see from the chat server console it is talking but it seems to be failing on the client authentication.

    When running wireshark i'm not seeing any traffic on ports (tcp.port == 10241) || (tcp.port == 9021) between the client and Chat Server.


  2. #2
    Developer DNC is offline
    DeveloperRank
    Oct 2011 Join Date
    2,493Posts

    Re: 3.5/3.7 Chat Server Help

    Please, go take a look in your Chat server folder. I've been coding a very long time and just stepped into the Aion area yesterday.
    But I've downloaded and examined over 5 versions of these different emu's. Still trying to find a decent setup, not had the time to test each of these, just examine them. I've also noticed that in 2 of these, that inside one of the startup scripts for the Chat server itself, that the script does in fact refresh every 10 seconds. It is how it monitors Chat.

    If you don't mind, could you please look inside those files found in your primary Chat server folder (startup folder) with the files ending in .bat and .sh. Open them in notepad or whatever your favorite editor of choice may be. Look for where it mentions that it refreshes every 10 seconds. If you find this, you'll see it was designed to monitor chat at this speed.

    This may or may not be the case for you, again I just started examining the code yesterday.
    I plan on finding one 3.0.x solution and going with it.



    On a side note, I have an additional question:
    Do your mobs respawn if you loot the corpses right away?
    If yes, would you be so kind as to point me to which version of the emu your using?
    Thank you in advance for your responses.


    *For those that do not know me*
    I'm an older guy, over 40, been writing emulators' for very large mmo's for nearly 27 years, I hope to be of use in this section.


    ----------Edit with snippet-----------
    For example Aion-Lightning-2 from code.google blah blah
    (Notice the sleep command for 10 seconds here as an example)

    The following is found in trunk\AL-CServer\dist\cserver_loop.sh

    Code:
    #!/bin/bash
    
    err=1
    until [ $err == 0 ];
    do
    	/home/java/bin/java -Xmx512m -cp ./libs/*:al-cserver-1.0.0.jar com.aionemu.chatserver.ChatServer > log/stdout.log 2>&1
    	err=$?
    	sleep 10
    done

    PS, it could very well be built into the packet samurai jar file.
    Last edited by DNC; 04-04-13 at 07:10 PM.

  3. #3
    Apprentice whiteone is offline
    MemberRank
    Sep 2011 Join Date
    15Posts

    Re: 3.5/3.7 Chat Server Help

    From looking through the code some more the CM_CHAT_AUTH & SM_CHAT_INIT should only be sent once every time you log into the game world which is leading me to believe that the client is not authorizing at some point. Did some packet capturing of live and a few other PS which have chat working and it's only sending them once. So need to find which step it failing at.

    *For those that do not know me*
    I'm an older guy, over 40, been writing emulators' for very large mmo's for nearly 27 years, I hope to be of use in this section.
    Someone older then me LOL just kidding i turn 40 in a few months. I mainly have worked with C++ & lua this is my first time working on a java built EMU really doing it more to learn it so it has been interesting.

    Do your mobs respawn if you loot the corpses right away?
    Not right away they respawn about the same rate as live.

    If yes, would you be so kind as to point me to which version of the emu your using?
    I'm using a 3.5 core converted to handle 3.7 so i can actually log in with the current live aion client.

    I'm using the following two download. They do need some work to get working correctly mainly just updated opcodes and some struct changes so far nothing to bad except for the ChatServer.

    Server
    File-Upload.net - 3.5.0-server.rar ** Click the download button above where it say's Tip: Upload Pic!

    ChatServer
    File-Upload.net - chatserver.zip ** Click the download button above where it say's Tip: Upload Pic!

    Core
    3.5.0.rar — Yandex.Disk

    Here is the thread i got the two links from to give them credit.
    Anarchy 3.5.0 ls gs - page 2 - Other Release projects Aion-Finish 3.7 Dev Team


    I also had to use Java SDK 6U41 i got the 64bit version from the following since java site was being difficult with there older version.
    https://build.dev.kthcorp.com/mirror...indows-x64.exe
    Last edited by whiteone; 04-04-13 at 08:28 PM.

  4. #4
    Developer DNC is offline
    DeveloperRank
    Oct 2011 Join Date
    2,493Posts

    Re: 3.5/3.7 Chat Server Help

    Thank you very much.
    I'll download and start looking through this as well.
    May as well have two people digging through it than one. :-)
    Give me a couple hours to get this downloaded, configured, and some time to examine how its behaving.

    Cheers

    PS Yes, I left the age comment alone lolol :-)

  5. #5
    Apprentice whiteone is offline
    MemberRank
    Sep 2011 Join Date
    15Posts

    Re: 3.5/3.7 Chat Server Help

    Here it is in 3.5.0\Game\src\com\aionemu\gameserver\network\aion\clientpackets\CM_CHAT_AUTH.java

    Code:
    package com.aionemu.gameserver.network.aion.clientpackets;
    
    import com.aionemu.gameserver.configs.main.GSConfig;
    import com.aionemu.gameserver.model.gameobjects.player.Player;
    import com.aionemu.gameserver.network.aion.AionClientPacket;
    import com.aionemu.gameserver.network.aion.AionConnection.State;
    import com.aionemu.gameserver.network.chatserver.ChatServer;
    
    /**
     * Client sends this only once.
     * 
     * @author Luno
     */
    public class CM_CHAT_AUTH extends AionClientPacket {
    
    	/**
    	 * Constructor
    	 * 
    	 * @param opcode
    	 */
    	public CM_CHAT_AUTH(int opcode, State state, State... restStates) {
    		super(opcode, state, restStates);
    	}
    
    	@Override
    	protected void readImpl() {
    		@SuppressWarnings("unused")
    		int objectId = readD(); // lol NC
    		@SuppressWarnings("unused")
    		byte[] macAddress = readB(6);
    	}
    
    	@Override
    	protected void runImpl() {
    		if (GSConfig.ENABLE_CHAT_SERVER) {
    			// this packet is sent sometimes after logout from world
    			Player player = getConnection().getActivePlayer();
    			if (!player.isInPrison()) {
    				ChatServer.getInstance().sendPlayerLoginRequst(player);
    			}
    		}
    	}
    }

    I'm wondering if it's not liking the token that is sent back in SM_CHAT_INIT from the chatserver.

  6. #6
    Developer DNC is offline
    DeveloperRank
    Oct 2011 Join Date
    2,493Posts

    Re: 3.5/3.7 Chat Server Help

    Your positive your using the same opcode for Chat as you are in (Game and Login)?
    I know you mentioned more up to date with current client, could be the issue.

  7. #7
    Apprentice whiteone is offline
    MemberRank
    Sep 2011 Join Date
    15Posts

    Re: 3.5/3.7 Chat Server Help

    Ops i forgot the most important part the chatserver i don't remember where i got the original link from but here it is.

    ChatServer
    File-Upload.net - chatserver.zip

    Quote Originally Posted by DNC View Post
    Your positive your using the same opcode for Chat as you are in (Game and Login)?
    I know you mentioned more up to date with current client, could be the issue.
    That opcode is only set in the Game Server and is just used for the initial communication then it get's handed off to the chat server which is on a different port 10241 & 9021 with it's own set of opcodes and from what i can tell by capturing them on live and live compatible private servers with wireshark those look fine since those are not encrypted.

  8. #8
    Developer DNC is offline
    DeveloperRank
    Oct 2011 Join Date
    2,493Posts

    Re: 3.5/3.7 Chat Server Help

    I just downloaded the other pieces and was looking lol.
    Give me a bit to grab lunch and setup up the configs and I'll give it a whirl.

    Not spamming every 10 seconds.

    I can click on each of the channels and it will switch unlike with Chat server off.
    I am not level 11 yet, but it is successfully logging.

    What worked / didn't work:
    (Click me) Opens new window/tab with thread relevant to this topic.
    This server runs fine with chat server, but not the one I downloaded from you. So it is something in the source files. Definitely game server library file related. At least its a starting point for narrowing it down. Compare libraries between the two builds that have to do with communication.

    What did work:
    Ran it against Aion-Lightning 3.0 from the link a few lines up. Worked perfectly.


    Output from my chat window after logging into the game:
    Spoiler:

    Code:
    -------------------------------------------------------------=[ ChatServerLog
    INFO [04 Apr 14:05:10,665] Total Boot Time: 0 seconds.
    INFO [04 Apr 14:06:38,982] Channel connected Ip:127.0.0.1
    INFO [04 Apr 14:06:38,998] SM_GS_AUTH_RESPOSE with chat addy and port
    INFO [04 Apr 14:06:38,998] Authed SM_GS_AUTH_RESPONSE
    INFO [04 Apr 14:07:46,333] Player registered from server side 97606
    INFO [04 Apr 14:07:46,333] SM_PLAYER_AUTH_RESPONSE opcode and token
    INFO [04 Apr 14:07:46,347] Channel connected Ip:127.0.0.1
    INFO [04 Apr 14:07:46,349] chatservice get player97606
    INFO [04 Apr 14:07:46,349] chatservice get token97606
    INFO [04 Apr 14:07:46,350] Player registered from client request 97606
    INFO [04 Apr 14:07:46,350] recieved CM_PLAYER_AUTH
    INFO [04 Apr 14:07:49,404] chatservice register player with channel
    INFO [04 Apr 14:07:49,404] Sending SM_CHANNEL_RESPONSE with channel 63 index 2
    INFO [04 Apr 14:07:49,405] chatservice register player with channel
    INFO [04 Apr 14:07:49,405] Sending SM_CHANNEL_RESPONSE with channel 27 index 3
    INFO [04 Apr 14:07:49,406] chatservice register player with channel
    INFO [04 Apr 14:07:49,406] Sending SM_CHANNEL_RESPONSE with channel 2 index 4
    INFO [04 Apr 14:07:52,397] chatservice register player with channel
    INFO [04 Apr 14:07:52,398] Sending SM_CHANNEL_RESPONSE with channel 80 index 5
    INFO [04 Apr 14:07:52,399] chatservice register player with channel
    INFO [04 Apr 14:07:52,399] Sending SM_CHANNEL_RESPONSE with channel 82 index 6
    Attached Thumbnails Attached Thumbnails chatserverisworking.png  
    Last edited by DNC; 04-04-13 at 09:35 PM.

  9. #9
    Apprentice whiteone is offline
    MemberRank
    Sep 2011 Join Date
    15Posts

    Re: 3.5/3.7 Chat Server Help

    Ahh i should have thought about trying a lower client version. Humm now the fun part trying to get it to work with the live client. This helps at least i know the chatserver works. :)

  10. #10
    Developer DNC is offline
    DeveloperRank
    Oct 2011 Join Date
    2,493Posts

    Re: 3.5/3.7 Chat Server Help

    I was wrong bro, look at my edit. I had accidentally ran the wrong server.
    Tested with yours failed.
    Tested with the edited post one, worked flawlessly.

    EDIT Not sure about client yet, I do not have a fully built one to test with. My client is 3.0.0.8
    Attached Thumbnails Attached Thumbnails chatserver_cashshop.gif  
    Last edited by DNC; 04-04-13 at 09:52 PM. Reason: Added photo of the server I mentioned

  11. #11
    Apprentice whiteone is offline
    MemberRank
    Sep 2011 Join Date
    15Posts

    Re: 3.5/3.7 Chat Server Help

    I'm leaning toward this in the ChatService.java going to throw some more logging in there when i get home tonight can't really do it since i'm at work.


    Code:
    public void registerPlayerConnection(int playerId, byte[] token, byte[] identifier, ClientChannelHandler channelHandler)
    	{
    		ChatClient chatClient = players.get(playerId);
    		log.info("chatservice get player" + playerId);
    		if(chatClient != null)
    		{
    			byte[] regToken = chatClient.getToken();
    			log.info("chatservice get token" + playerId);
    			if(Arrays.equals(regToken, token))
    			{
    				chatClient.setIdentifier(identifier);
    				chatClient.setChannelHandler(channelHandler);
    				channelHandler.sendPacket(new SM_PLAYER_AUTH_RESPONSE());
    				channelHandler.setState(State.AUTHED);
    				channelHandler.setChatClient(chatClient);
    				BroadcastService.getInstance().addClient(chatClient);
    				log.info("Player registered from client request " + playerId);
    			}
    		}
    	}

  12. #12
    Developer DNC is offline
    DeveloperRank
    Oct 2011 Join Date
    2,493Posts

    Re: 3.5/3.7 Chat Server Help

    Between Game and Chat servers yes, it is going to be a matter of tweaking one or the other to work properly.
    Wish I had not uninstalled NCSoft and kept the 3.5 version. Really don't want to be here patching for hours again he he.

    api documentation link:
    http://www.mediafire.com/?9p9ekdipwzu4xxd
    this is from http://aion-lightning-2.googlecode.com/svn/trunk/doc
    but should be useful


    Edited 9 PM EST
    I've just built u3j-aion build 504 which is up to March 23, 2013. They put in a temporary dropservice.
    I'm going to go ahead and test with this and see about submitting some solutions to issues.
    I did get the cash shop setup fully versus the 4 wings that come default, among a few other corrections.

    I'll work on this one this weekend, but for now just going to play and relax. Have no time until Saturday to truly dig into the communication layer. It is going to be a bit more than just the jar file you mentioned, I don't believe too much more. But I'm tired and want to just relax for the evening.
    I'll keep updates here and hope you do likewise whiteone.
    Cheers
    Last edited by DNC; 05-04-13 at 03:05 AM.

  13. #13
    Apprentice whiteone is offline
    MemberRank
    Sep 2011 Join Date
    15Posts

    Re: 3.5/3.7 Chat Server Help

    Still no luck with getting the chat server working really leaning toward the token tho since everything else look's right. Going to keep messing with it till either one pops up that works or i get it to work. :)



Advertisement