|
You last visited: Today at 02:57
Advertisement
[Help] 5095 StarServer.
Discussion on [Help] 5095 StarServer. within the CO2 Private Server forum part of the Conquer Online 2 category.
10/10/2010, 00:22
|
#1
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
[Help] 5095 StarServer.
alright so I've recently encountered this problem. I have not made any "Major" modifications to the StartServer void just a few(I have tried everything but still nothing)... but I have token the ones I put in out and it still tells me this:
Quote:
|
The type initializer for 'CoEmu_v2_GameServer.Nano' threw an exception.
|
here is my StartServer void:
Code:
public static void StartServer()
{
QuizShowInfo[(byte)1] = "Dany";
QuizShowInfo[(ushort)1] = 245;
QuizShowInfo[1] = 100;
QuizShowInfo[(byte)2] = "Lord";
QuizShowInfo[(ushort)2] = 244;
QuizShowInfo[2] = 200;
QuizShowInfo[(byte)3] = "Quiz-Master";
QuizShowInfo[(ushort)3] = 243;
QuizShowInfo[3] = 400;
GenerateKey();
Struct.LoadItems("items.txt");
Struct.LoadItemPluses("itemadd.ini");
Struct.LoadMaps();
Struct.LoadMonsters();
Struct.LoadNpcs();
Struct.LoadPortals();
Struct.LoadServerskills();
Struct.LoadTNpcs();
Struct.LoadFeatures();
Struct.LoadGuilds();
Database.Database.LoadRevivePoints();
Database.Database.LoadEnchantData();
Database.Database.LoadTops();
//Database.Database.PurgeGuilds();
Console.WriteLine("This program is a branch of CoEmu.Nano, property of the CoEmu Foundation.");
Console.WriteLine("[GameServer-Init] Creating Game Thread..");
Nano.GameServer = new MasterSocket("GameServer");
new Thread(Nano.GameServer.AcceptNewConnections).Start();
Console.WriteLine("[GameServer-Init](Game Thread) Success.");
Console.WriteLine("[GameServer-Init] Creating Auth Thread..");
Nano.AuthServer = new MasterSocket("AuthServer");
new Thread(Nano.AuthServer.AcceptNewConnections).Start();
Console.WriteLine("[GameServer-Init](Auth Thread) Success.");
CharacterThread = new CoEmuThread(); CharacterThread.Start(CharacterCheck);
SummonedGuardsThread = new CoEmuThread(); SummonedGuardsThread.Start(SummonedGuardsCheck);
GuardsThread = new CoEmuThread(); GuardsThread.Start(GuardsCheck);
BroadCastTimer = DateTime.Now;
RandEventTimer = DateTime.Now;
PkTournyStarTime = DateTime.Now;
TradePartnerCount = DateTime.Now;
LastMobsMove = DateTime.Now;
LastDMapCheck = DateTime.Now;
CheckWalk = DateTime.Now;
GuildScores = DateTime.Now;
LastUpdateSite = DateTime.Now;
LastGuildPoints = DateTime.Now;
ServerToolsThread = new CoEmuThread(); ServerToolsThread.Start(ToolsCheck);
ConsoleCommands();
}
much help would be appreciated.
|
|
|
10/10/2010, 01:23
|
#2
|
elite*gold: 0
Join Date: Aug 2010
Posts: 992
Received Thanks: 1,110
|
nothing is worng with this void
your Problem is in Accepting a New Connection though
plus you should look at this void like its just a list for the stuff that the server well load/Execute/start/etcetc
Code:
public static void StartServer()
{
QuizShowInfo[(byte)1] = "Dany";
QuizShowInfo[(ushort)1] = 245;
QuizShowInfo[1] = 100;
QuizShowInfo[(byte)2] = "Lord";
QuizShowInfo[(ushort)2] = 244;
QuizShowInfo[2] = 200;
QuizShowInfo[(byte)3] = "Quiz-Master";
QuizShowInfo[(ushort)3] = 243;
QuizShowInfo[3] = 400;
GenerateKey();
Struct.LoadItems("items.txt");
Struct.LoadItemPluses("itemadd.ini");
Struct.LoadMaps();
Struct.LoadMonsters();
Struct.LoadNpcs();
Struct.LoadPortals();
Struct.LoadServerskills();
Struct.LoadTNpcs();
Struct.LoadFeatures();
Struct.LoadGuilds();
Database.Database.LoadRevivePoints();
Database.Database.LoadEnchantData();
Database.Database.LoadTops();
//Database.Database.PurgeGuilds();
Console.WriteLine("This program is a branch of CoEmu.Nano, property of the CoEmu Foundation.");
Console.WriteLine("[GameServer-Init] Creating Game Thread..");
[COLOR="DarkRed"]Nano.GameServer = new MasterSocket("GameServer");
new Thread(Nano.GameServer.AcceptNewConnections).Start();[/COLOR]
Console.WriteLine("[GameServer-Init](Game Thread) Success.");
Console.WriteLine("[GameServer-Init] Creating Auth Thread..");
[COLOR="DarkRed"]Nano.AuthServer = new MasterSocket("AuthServer");
new Thread(Nano.AuthServer.AcceptNewConnections).Start();[/COLOR]
Console.WriteLine("[GameServer-Init](Auth Thread) Success.");
CharacterThread = new CoEmuThread(); CharacterThread.Start(CharacterCheck);
SummonedGuardsThread = new CoEmuThread(); SummonedGuardsThread.Start(SummonedGuardsCheck);
GuardsThread = new CoEmuThread(); GuardsThread.Start(GuardsCheck);
BroadCastTimer = DateTime.Now;
RandEventTimer = DateTime.Now;
PkTournyStarTime = DateTime.Now;
TradePartnerCount = DateTime.Now;
LastMobsMove = DateTime.Now;
LastDMapCheck = DateTime.Now;
CheckWalk = DateTime.Now;
GuildScores = DateTime.Now;
LastUpdateSite = DateTime.Now;
LastGuildPoints = DateTime.Now;
ServerToolsThread = new CoEmuThread(); ServerToolsThread.Start(ToolsCheck);
ConsoleCommands();
}
make sure you dident change any of the server connection setting else when you start the server and that exception pup up it wold be high lighted so you can see it follow that high lighted line by one clicking each colored
Quote:
example
Nano.GameServer = new MasterSocket("GameServer");
new Thread(Nano.GameServer.AcceptNewConnections).Start ();
|
part and hit F12 that well take you to the definition for each void you have there make sure they are all fine and nothing has changed else idk :P
|
|
|
10/10/2010, 01:25
|
#3
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
Quote:
Originally Posted by { Angelius }
your Problem is in Accepting a New Connection
make sure you dident change any of the server connection setting else when you start the server and that exception pup up it wold be high lighted so you can see it follow that high lighted line by one clicking each colored part and hit F12 that well take you to the definition for each void you have there make sure they are all fine and nothing has changed else idk :P
|
nah bra...I tried it but it still gives me that same ****** error >.<
|
|
|
10/10/2010, 01:29
|
#4
|
elite*gold: 0
Join Date: Aug 2010
Posts: 992
Received Thanks: 1,110
|
can you post the line only the highlighted line ?
|
|
|
10/10/2010, 01:31
|
#5
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
Quote:
Originally Posted by { Angelius }
can you post the line only the highlighted line ?
|
this is the highlighted line it goes straight to, once it starts up.
Code:
Nano.StartServer();
it's in yellow color btw...
|
|
|
10/10/2010, 01:41
|
#6
|
elite*gold: 0
Join Date: Aug 2010
Posts: 992
Received Thanks: 1,110
|
idk what did you edit but the start server part must go Through those lines so try to replace it with this one and let me know
Code:
public static void StartServer()
{
GenerateKey();
Nano.GameServer = new MasterSocket("GameServer");
new Thread(Nano.GameServer.AcceptNewConnections).Start();
Nano.AuthServer = new MasterSocket("AuthServer");
new Thread(Nano.AuthServer.AcceptNewConnections).Start();
CharacterThread = new CoEmuThread(); CharacterThread.Start(CharacterCheck);
BroadCastTimer = DateTime.Now;
RandEventTimer = DateTime.Now;
PkTournyStarTime = DateTime.Now;
TradePartnerCount = DateTime.Now;
LastMobsMove = DateTime.Now;
LastDMapCheck = DateTime.Now;
CheckWalk = DateTime.Now;
GuildScores = DateTime.Now;
LastUpdateSite = DateTime.Now;
LastGuildPoints = DateTime.Now;
ServerToolsThread = new CoEmuThread(); ServerToolsThread.Start(ToolsCheck);
ConsoleCommands();
}
after that try this one
Code:
public static void StartServer()
{
GenerateKey();
Nano.GameServer = new MasterSocket("GameServer");
new Thread(Nano.GameServer.AcceptNewConnections).Start();
Nano.AuthServer = new MasterSocket("AuthServer");
new Thread(Nano.AuthServer.AcceptNewConnections).Start();
CharacterThread = new CoEmuThread(); CharacterThread.Start(CharacterCheck);
ServerToolsThread = new CoEmuThread(); ServerToolsThread.Start(ToolsCheck);
ConsoleCommands();
}
this way you can only test the connection and make sure what is the problem connection or loading good luck and let me know plz
|
|
|
10/10/2010, 01:50
|
#7
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
Quote:
Originally Posted by { Angelius }
idk what did you edit but the start server part must go Through those lines so try to replace it with this one and let me know
Code:
public static void StartServer()
{
GenerateKey();
Nano.GameServer = new MasterSocket("GameServer");
new Thread(Nano.GameServer.AcceptNewConnections).Start();
Nano.AuthServer = new MasterSocket("AuthServer");
new Thread(Nano.AuthServer.AcceptNewConnections).Start();
CharacterThread = new CoEmuThread(); CharacterThread.Start(CharacterCheck);
BroadCastTimer = DateTime.Now;
RandEventTimer = DateTime.Now;
PkTournyStarTime = DateTime.Now;
TradePartnerCount = DateTime.Now;
LastMobsMove = DateTime.Now;
LastDMapCheck = DateTime.Now;
CheckWalk = DateTime.Now;
GuildScores = DateTime.Now;
LastUpdateSite = DateTime.Now;
LastGuildPoints = DateTime.Now;
ServerToolsThread = new CoEmuThread(); ServerToolsThread.Start(ToolsCheck);
ConsoleCommands();
}
after that try this one
Code:
public static void StartServer()
{
GenerateKey();
Nano.GameServer = new MasterSocket("GameServer");
new Thread(Nano.GameServer.AcceptNewConnections).Start();
Nano.AuthServer = new MasterSocket("AuthServer");
new Thread(Nano.AuthServer.AcceptNewConnections).Start();
CharacterThread = new CoEmuThread(); CharacterThread.Start(CharacterCheck);
ServerToolsThread = new CoEmuThread(); ServerToolsThread.Start(ToolsCheck);
ConsoleCommands();
}
this way you can only test the connection and make sure what is the problem connection or loading good luck and let me know plz
|
still gettin the exact same error after trying both =/
|
|
|
10/10/2010, 01:57
|
#8
|
elite*gold: 0
Join Date: Aug 2010
Posts: 992
Received Thanks: 1,110
|
ok there is a file called sockets you can reach it by right clicking and say go to definition on where it says MasterSocket
Code:
new Thread(Nano.GameServer.AcceptNewConnections).Start();
Nano.AuthServer = new [COLOR="Red"]MasterSocket[/COLOR]("AuthServer");
once you are there you should see something like this
Code:
public class MasterSocket
{
protected Socket ServerSocket;
protected const int LOGIN_PORT = 9958;
protected const string SERVER_IP = "5.195.232.181";
protected const string SITE_IP = "127.0.0.1";
protected const int AUTH_PORT = 5817;
protected const int GAME_PORT = 5816;
protected string ServerName;
protected static bool Continue = true;
public [COLOR="Red"]MasterSocket[/COLOR](string name)
{
ServerName = name;
if (name == "[COLOR="Red"]GameServer[/COLOR]")
{
ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint IPE = new IPEndPoint(new IPAddress(0), GAME_PORT);
try
{
ServerSocket.Bind(IPE);
}
catch (Exception EXC)
{
Program.WriteLine("[" + name + "-Init] Failed, unable to bind server to socket.");
Program.WriteLine(EXC);
System.Environment.Exit(-1);
}
}
else if (name == "[COLOR="Red"]AuthServer[/COLOR]")
{
ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint IPE = new IPEndPoint(new IPAddress(0), AUTH_PORT);
try
{
ServerSocket.Bind(IPE);
}
catch (Exception e)
{
Program.WriteLine("[" + name + "-Init] Failed, unable to bind server to socket.");
Program.WriteLine(e.StackTrace);
System.Environment.Exit(-1);
}
}
}
public void AcceptNewConnections()
{
ServerSocket.Listen(100);
while (Continue)
{
if (ServerName == "GameServer")
{
Socket CSocket = null;
try
{
CSocket = ServerSocket.Accept();
}
catch (Exception e)
{
Program.WriteLine("Unable to accept a new connection, closing now.");
ServerSocket.Close();
Program.WriteLine(e.StackTrace);
return;
}
try
{
if (CSocket.Connected)
{
if (!CSocket.RemoteEndPoint.ToString().Contains(SITE_IP))
{
ClientSocket CS = new ClientSocket(CSocket);
new Thread(CS.Run).Start();
}
else
{
CSocket.Close();
}
}
}
catch (Exception e)
{
if (CSocket != null)
CSocket.Close();
Program.WriteLine("[GameServer] Unable to login a new client, see exception print below.");
Program.WriteLine(e.ToString());
}
}
if (ServerName == "AuthServer")
{
Socket ASocket = null;
try
{
ASocket = ServerSocket.Accept();
}
catch (Exception e)
{
Program.WriteLine("Unable to accept data from Auth Server.");
ServerSocket.Close();
Program.WriteLine(e.ToString());
return;
}
if (ASocket != null)
{
try
{
byte[] Buffer = new byte[8092];
int size = ASocket.Receive(Buffer);
byte[] Data = new byte[size];
Array.Copy(Buffer, Data, size);
AuthHandler.HandleAuth(Data, ASocket);
Data = null;
Buffer = null;
}
catch (Exception e)
{
Program.WriteLine(e.ToString());
}
}
}
}
}
public void Close()
{
Program.WriteLine("[" + ServerName + "-End] Closing Socket.");
ServerSocket.Close();
Continue = false;
if (ServerName == "GameServer")
{
World.Continue = false;
}
}
}
}
and that is the problem my friend its only a connection problem check all the ip's/ports/all other connection info and that should do it
|
|
|
10/10/2010, 02:01
|
#9
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
Quote:
Originally Posted by { Angelius }
ok there is a file called sockets you can reach it by right clicking and say go to definition on where it says MasterSocket
Code:
new Thread(Nano.GameServer.AcceptNewConnections).Start();
Nano.AuthServer = new [COLOR="Red"]MasterSocket[/COLOR]("AuthServer");
once you are there you should see something like this
Code:
public class MasterSocket
{
protected Socket ServerSocket;
protected const int LOGIN_PORT = 9958;
protected const string SERVER_IP = "5.195.232.181";
protected const string SITE_IP = "127.0.0.1";
protected const int AUTH_PORT = 5817;
protected const int GAME_PORT = 5816;
protected string ServerName;
protected static bool Continue = true;
public [COLOR="Red"]MasterSocket[/COLOR](string name)
{
ServerName = name;
if (name == "[COLOR="Red"]GameServer[/COLOR]")
{
ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint IPE = new IPEndPoint(new IPAddress(0), GAME_PORT);
try
{
ServerSocket.Bind(IPE);
}
catch (Exception EXC)
{
Program.WriteLine("[" + name + "-Init] Failed, unable to bind server to socket.");
Program.WriteLine(EXC);
System.Environment.Exit(-1);
}
}
else if (name == "[COLOR="Red"]AuthServer[/COLOR]")
{
ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint IPE = new IPEndPoint(new IPAddress(0), AUTH_PORT);
try
{
ServerSocket.Bind(IPE);
}
catch (Exception e)
{
Program.WriteLine("[" + name + "-Init] Failed, unable to bind server to socket.");
Program.WriteLine(e.StackTrace);
System.Environment.Exit(-1);
}
}
}
public void AcceptNewConnections()
{
ServerSocket.Listen(100);
while (Continue)
{
if (ServerName == "GameServer")
{
Socket CSocket = null;
try
{
CSocket = ServerSocket.Accept();
}
catch (Exception e)
{
Program.WriteLine("Unable to accept a new connection, closing now.");
ServerSocket.Close();
Program.WriteLine(e.StackTrace);
return;
}
try
{
if (CSocket.Connected)
{
if (!CSocket.RemoteEndPoint.ToString().Contains(SITE_IP))
{
ClientSocket CS = new ClientSocket(CSocket);
new Thread(CS.Run).Start();
}
else
{
CSocket.Close();
}
}
}
catch (Exception e)
{
if (CSocket != null)
CSocket.Close();
Program.WriteLine("[GameServer] Unable to login a new client, see exception print below.");
Program.WriteLine(e.ToString());
}
}
if (ServerName == "AuthServer")
{
Socket ASocket = null;
try
{
ASocket = ServerSocket.Accept();
}
catch (Exception e)
{
Program.WriteLine("Unable to accept data from Auth Server.");
ServerSocket.Close();
Program.WriteLine(e.ToString());
return;
}
if (ASocket != null)
{
try
{
byte[] Buffer = new byte[8092];
int size = ASocket.Receive(Buffer);
byte[] Data = new byte[size];
Array.Copy(Buffer, Data, size);
AuthHandler.HandleAuth(Data, ASocket);
Data = null;
Buffer = null;
}
catch (Exception e)
{
Program.WriteLine(e.ToString());
}
}
}
}
}
public void Close()
{
Program.WriteLine("[" + ServerName + "-End] Closing Socket.");
ServerSocket.Close();
Continue = false;
if (ServerName == "GameServer")
{
World.Continue = false;
}
}
}
}
and that is the problem my friend its only a connection problem check all the ip's/ports/all other connection info and that should do it
|
so ur tellin me that my GameServer crashing is a connection problem? wtf lol.?
|
|
|
10/10/2010, 02:05
|
#10
|
elite*gold: 0
Join Date: Aug 2010
Posts: 992
Received Thanks: 1,110
|
yep
|
|
|
10/10/2010, 02:09
|
#11
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
Quote:
Originally Posted by { Angelius }
yep
|
impossible. that's only if you can't login to your server/login-freeze.
My GameServer crashing has something to do with the StartServer void(or something being added to it) not the MasterSocket thread lol...
|
|
|
10/10/2010, 02:23
|
#12
|
elite*gold: 0
Join Date: Aug 2010
Posts: 992
Received Thanks: 1,110
|
this is your start server an if you dident touch it like you said before than it must work fine place this one and try to run the server
Code:
public static void StartServer()
{
GenerateKey();
Nano.AuthServer = new MasterSocket("AuthServer");
new Thread(Nano.AuthServer.AcceptNewConnections).Start();
CharacterThread = new CoEmuThread(); CharacterThread.Start(CharacterCheck);
ServerToolsThread = new CoEmuThread(); ServerToolsThread.Start(ToolsCheck);
ConsoleCommands();
}
|
|
|
10/10/2010, 02:29
|
#13
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
Quote:
Originally Posted by { Angelius }
this is your start server an if you dident touch it like you said before than it must work fine place this one and try to run the server
Code:
public static void StartServer()
{
GenerateKey();
Nano.AuthServer = new MasterSocket("AuthServer");
new Thread(Nano.AuthServer.AcceptNewConnections).Start();
CharacterThread = new CoEmuThread(); CharacterThread.Start(CharacterCheck);
ServerToolsThread = new CoEmuThread(); ServerToolsThread.Start(ToolsCheck);
ConsoleCommands();
}
|
nothing there bro...
|
|
|
10/10/2010, 02:32
|
#14
|
elite*gold: 0
Join Date: Aug 2010
Posts: 992
Received Thanks: 1,110
|
what dose that mean DID YOU GET THE SAME EXCEPTION ???
|
|
|
10/10/2010, 02:33
|
#15
|
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
|
Quote:
Originally Posted by { Angelius }
what dose that mean DID YOU GET THE SAME EXCEPTION ???
|
calm down buddy...and yes I got the same exception.
|
|
|
Similar Threads
|
[Help 5095]Can Any One Gave Me Code To Love Stone In source Binary 5095
04/18/2010 - CO2 Private Server - 1 Replies
Can Any One Gave Me Code To Love Stone In source Binary 5095 from his source
Cuz I Have problem in marriage
love stone gave u flower and when u send it nothing sent to Your Frind
And I Think Problem In This Code
400011 400012 0 124 1067
|
[Help]5095
02/20/2010 - CO2 Private Server - 2 Replies
Version 5095
first question:
Second Question:
could someone help me please
|
BOT 5095
02/19/2010 - Conquer Online 2 - 5 Replies
i need bots for autolever, auto scater, auto loot and others thanks for all
|
All times are GMT +1. The time now is 02:57.
|
|