Most visitors online was 3655 , on 17 Nov 2023
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!It's not used further in this ChatServer... only relevant for OpenMU full server
public void ChatRoomCreated(ChatServerAuthenticationInfo authenticationInfo, string friendname, bool success)
{
var authenticationTokenArray = uint.Parse(authenticationInfo.AuthenticationToken).ToBytesSmallEndian();
var chatRoomId = authenticationInfo.RoomId;
var packet = new byte[] { 0xC3, 0x24, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // chat server ip (without port)
chatRoomId.GetLowByte(), chatRoomId.GetHighByte(),
authenticationTokenArray[3], authenticationTokenArray[2],
authenticationTokenArray[1], authenticationTokenArray[0],
0x01, // type
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // friendname success ? (byte)1 : (byte)0
};
// chatserver unavailable would have success = 2, type = 0xAF
[COLOR=#ff0000]var chatServerIp = this.friendServer.GetChatserverIP();
[/COLOR] Encoding.ASCII.GetBytes(chatServerIp, 0, chatServerIp.Length, packet, 3);
Encoding.UTF8.GetBytes(friendname, 0, friendname.Length, packet, 25);
this.connection.Send(packet);
}
[COLOR=#ff0000]WANIP=192.168.xx.xx
[/COLOR]
ChatServerListenerPort=55980
ExDbHost=127.0.0.1
ExDbPort=55906Xor32
Key=AB 11 CD FE 18 23 C5 A3 CA 33 C1 CC 66 67 21 F3 32 12 15 35 29 FF FE 1D 44 EF CD 41 26 3C 4E 4D
//...
[COLOR=#ff0000]public string PublicIp { get; set; }
[/COLOR]private readonly string publicIp;
//...
this.publicIp = PublicIpResolver.GetIPv4().ToString();
//this.publicIp = "192.168.xxx.xxx";
internal class Settings
{
//...
public string ChatServerWANIP
{
get
{
if (this["WANIP"] != null)
{
var s = this["WANIP"];
var match = Regex.Match(s, @".*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*");
return match.Success ? s : null;
}
return null;
}
}
//...
}
internal static void Main(string[] args)
{
//...
var chatServer = new ChatServerListener(chatServerListenerPort);
[COLOR=#ff0000]//Get WANIP Config, If it's null. keep the IP retrieved from //https://api.ipify.org/?format=text
[/COLOR] [COLOR=#ff0000]chatServer.PublicIp = settings.ChatServerWANIP ?? chatServer.PublicIp;
[/COLOR] [COLOR=#ff0000]Log.Info($"WANIP = {chatServer.PublicIp}");
[/COLOR] chatServer.Xor32Key = customXor32Key ?? chatServer.Xor32Key; chatServer.Start();
//...
}
this.publicIp = PublicIpResolver.GetIPv4().ToString();
//this.publicIp = "192.168.xxx.xxx";
Change WANIP in config file ChatServer.cfg if you re-code like above. (keep PublicIpResolver.GetIPv4().ToString(); in case you are failed to retrieved WANIP from .cfg)... good for publishmentSo there is no need to change
That's code of the "Full" OpenMU Server. Believe me, you don't need these changes-.- That string "publicIp" is used to pass to Player when ChatRoom created
Code:public void ChatRoomCreated(ChatServerAuthenticationInfo authenticationInfo, string friendname, bool success) { var authenticationTokenArray = uint.Parse(authenticationInfo.AuthenticationToken).ToBytesSmallEndian(); var chatRoomId = authenticationInfo.RoomId; var packet = new byte[] { 0xC3, 0x24, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // chat server ip (without port) chatRoomId.GetLowByte(), chatRoomId.GetHighByte(), authenticationTokenArray[3], authenticationTokenArray[2], authenticationTokenArray[1], authenticationTokenArray[0], 0x01, // type 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // friendname success ? (byte)1 : (byte)0 }; // chatserver unavailable would have success = 2, type = 0xAF [COLOR=#ff0000]var chatServerIp = this.friendServer.GetChatserverIP(); [/COLOR] Encoding.ASCII.GetBytes(chatServerIp, 0, chatServerIp.Length, packet, 3); Encoding.UTF8.GetBytes(friendname, 0, friendname.Length, packet, 25); this.connection.Send(packet); }
-.- That string "publicIp" is used to pass to Player when ChatRoom created
Code:public void ChatRoomCreated(ChatServerAuthenticationInfo authenticationInfo, string friendname, bool success) { var authenticationTokenArray = uint.Parse(authenticationInfo.AuthenticationToken).ToBytesSmallEndian(); var chatRoomId = authenticationInfo.RoomId; var packet = new byte[] { 0xC3, 0x24, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // chat server ip (without port) chatRoomId.GetLowByte(), chatRoomId.GetHighByte(), authenticationTokenArray[3], authenticationTokenArray[2], authenticationTokenArray[1], authenticationTokenArray[0], 0x01, // type 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // friendname success ? (byte)1 : (byte)0 }; // chatserver unavailable would have success = 2, type = 0xAF [COLOR=#ff0000]var chatServerIp = this.friendServer.GetChatserverIP(); [/COLOR] Encoding.ASCII.GetBytes(chatServerIp, 0, chatServerIp.Length, packet, 3); Encoding.UTF8.GetBytes(friendname, 0, friendname.Length, packet, 25); this.connection.Send(packet); }
Adding WANIP to config file
ChatServer.ExDbConnector ChatServer.cfg
Code:[COLOR=#ff0000]WANIP=192.168.xx.xx [/COLOR] ChatServerListenerPort=55980 ExDbHost=127.0.0.1 ExDbPort=55906Xor32 Key=AB 11 CD FE 18 23 C5 A3 CA 33 C1 CC 66 67 21 F3 32 12 15 35 29 FF FE 1D 44 EF CD 41 26 3C 4E 4D
ChatServer ChatServerListener.cs
Code://... [COLOR=#ff0000]public string PublicIp { get; set; } [/COLOR]private readonly string publicIp; //... this.publicIp = PublicIpResolver.GetIPv4().ToString(); //this.publicIp = "192.168.xxx.xxx";
ChatServer.ExDbConnector Setting.cs
Code:internal class Settings { //... public string ChatServerWANIP { get { if (this["WANIP"] != null) { var s = this["WANIP"]; var match = Regex.Match(s, @".*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*"); return match.Success ? s : null; } return null; } } //... }
ChatServer.ExDbConnector Program.cs
Code:internal static void Main(string[] args) { //... var chatServer = new ChatServerListener(chatServerListenerPort); [COLOR=#ff0000]//Get WANIP Config, If it's null. keep the IP retrieved from //https://api.ipify.org/?format=text [/COLOR] [COLOR=#ff0000]chatServer.PublicIp = settings.ChatServerWANIP ?? chatServer.PublicIp; [/COLOR] [COLOR=#ff0000]Log.Info($"WANIP = {chatServer.PublicIp}"); [/COLOR] chatServer.Xor32Key = customXor32Key ?? chatServer.Xor32Key; chatServer.Start(); //... }
That's code of the "Full" OpenMU Server. Believe me, you don't need these changes![]()
he managed to make it work.
I'm using the default and I can not make it work.
@solarismu
Could you post the configuration files of your dataserver and the chatserver?
inbox me your teamviewer
this.publicIp = "192.168.1.5";
You must be registered to see links
remember edit:
WANIP in CharServer.cfg & WANIP in DataServer\IGCDS.ini
ExDbPort in CharServer & ExDataServerPort in DataServer\IGCDS.ini
Ps: if it works, let me know ty
m_ChatServerPort = GetPrivateProfileIntA("Connection", "ChatPort", 55980, filedec);
m_ChatServerPort = 55980;
//m_ChatServerPort = GetPrivateProfileIntA("Connection", "ChatPort", 55980, filedec);
Can you find out where the Client tries to connect when you start a chat?
With netstat and/or wireshark, for example.
2018-04-03 20:09:42,099 [ERROR] [ExDbClient] - An error occured while processing an incoming packet from ExDB: C1 16 A1 00 02 00 54 65 63 4D 55 00 00 00 00 00 82 2E 03 00 01 00
System.ArgumentException: RegisterClient: Could not find chat room with id 512 for 'TecMU'.
Nome do parâmetro: roomId
em MUnique.OpenMU.ChatServer.ChatServerListener.RegisterClient(UInt16 roomId, String clientName) na C:\src\src\ChatServer\ChatServerListener.cs:linha 94
em MUnique.OpenMU.ChatServer.ExDbConnector.ExDbClient.ReadChatRoomInvitation(Byte[] packet) na C:\src\src\ChatServer\ExDbConnector\ExDbClient.cs:linha 144
em MUnique.OpenMU.ChatServer.ExDbConnector.ExDbClient.ExDbPacketReceived(Object sender, Byte[] packet) na C:\src\src\ChatServer\ExDbConnector\ExDbClient.cs:linha 116
@or30n
I've checked ADMTec Files...
You also have to check ServerInfo.bmd chatport
Or in IGCDLL source > ServerInfo.cpp
set it to 55980 for sure, like this.Code:m_ChatServerPort = GetPrivateProfileIntA("Connection", "ChatPort", 55980, filedec);
Code:m_ChatServerPort = 55980; //m_ChatServerPort = GetPrivateProfileIntA("Connection", "ChatPort", 55980, filedec);