photon server: cannot start my application

Options
brian661
edited January 2014 in Photon Server
today i am building my game as usual with photon server and when i am debugging my NGUI layout,
my server suddenly cannot be login.

unity give me an error message that :
[code2=csharp]ArgumentException: Can't use encryption yet. Exchange keys first.
ExitGames.Client.Photon.PhotonPeer.OpCustom (Byte customOpCode, System.Collections.Generic.Dictionary`2 customOpParameters, Boolean sendReliable, Byte channelId, Boolean encrypt)
PhotonService.Login (System.String MemberID, System.String MemberPW) (at Assets/plugin/PhotonService.cs:275)[/code2]

This exception i always saw if i immediately login to my game after i turn the server on.
and i have to wait for an while before i can log in.

while this time, i have wait for an hour, but i still cannot log in the game.
i open my log and see that, before when i turn on my server, the below debug message must be shown:

[code2=csharp]2014-01-11 16:01:22,632 [1] INFO EZServer.EZServerApplication [(null)] - EZSefgfgfgfrver is running...
2014-01-11 16:01:22,646 [1] INFO Photon.SocketServer.ApplicationBase [(null)] - Application start: AppId=EZServer; AppPath=C:\Program Files (x86)\deploy\EZServer, Type=EZServer.EZServerApplication
2014-01-11 16:02:15,548 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating AverageCounter: Name=''
2014-01-11 16:02:15,554 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating NumericCounter: Name=''
2014-01-11 16:02:15,557 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating CountsPerSecondCounter: Name=''
2014-01-11 16:02:15,562 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating CountsPerSecondCounter: Name=''
2014-01-11 16:02:15,563 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating NumericCounter: Name=''
2014-01-11 16:02:15,564 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating CountsPerSecondCounter: Name=''
2014-01-11 16:02:15,565 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating NumericCounter: Name=''
2014-01-11 16:02:15,566 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating CountsPerSecondCounter: Name=''
2014-01-11 16:02:15,570 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating CountsPerSecondCounter: Name=''
2014-01-11 16:02:15,571 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating NumericCounter: Name=''
2014-01-11 16:02:15,573 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating CountsPerSecondCounter: Name=''
2014-01-11 16:02:15,574 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating CountsPerSecondCounter: Name=''
2014-01-11 16:02:15,575 [16] DEBUG ExitGames.Diagnostics.Counter.CounterBase [(null)] - Creating NumericCounter: Name=''
2014-01-11 16:02:15,588 [16] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - ConnID=0, IP 192.168.0.100 on port 5055
2014-01-11 16:02:15,604 [16] DEBUG Photon.SocketServer.Protocol [(null)] - Parsed init message for application EZServer, client version 3.0.1, protocol GpBinaryV2 version 1.6
2014-01-11 16:02:15,617 [16] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - response sent to ConnId 0 with SendResult Ok[/code2]
while now, i just get there message:

[code2=csharp]2014-01-12 00:16:05,191 [1] INFO EZServer.EZServerApplication [(null)] - EZSefgfgfgfrver is running...
2014-01-12 00:16:05,208 [1] INFO Photon.SocketServer.ApplicationBase [(null)] - Application start: AppId=EZServer; AppPath=C:\Program Files (x86)\deploy\EZServer, Type=EZServer.EZServerApplication[/code2]
do anyone know whats is happened?
Some more actions that i have do before the sever cannot be open: 1)debug in unity and i log in to my game
2)without exit the play mode ,i switch my computer to sleep mode
3)after some hour, i am back and continue my work, but the server cannot be opened.

i have not change any codes between.

Comments

  • chvetsov
    Options
    hi, brian661

    Well, it is diffucult to say what is going on on your pc. I belive you tried to restart server and you application and this did not help

    I have questions to you. Do you exchenge with encryption keys manualy or this is done by some photon code?
    I mean do you call explictly peer.EstablishEncryption()?
  • yes, i have call EstablishEncryption in my call in OnStatusChanged
    [code2=csharp]public void OnStatusChanged (StatusCode statusCode)
    {
    Debug.Log("PeerStatusCallback:" + statusCode.ToString());
    switch (statusCode)
    {
    case StatusCode.Connect:
    this.peer.EstablishEncryption(); //encrytion function after connection
    break;
    case StatusCode.Disconnect:
    this.peer = null;
    this.ServerConnected = false;
    ConnectEvent(false);
    break;
    case StatusCode.EncryptionEstablished : //encrytion started
    this.ServerConnected = true;
    Debug.Log("HI");
    ConnectEvent(false); //finish connection
    break;
    }
    }[/code2]

    I am trying to fix the problem for the whole day and i find that
    yesterday, after i enter the play mode in unity and log in my server for debugging,
    i leave my computer without exit the play mode, and before i come back,
    my internet down for an while, and after that i cannot log in my server any more.
    I do not know is this cause my problem.

    I have also tried to log in the server in visual studio instead of unity,
    and i successfully log in, while i haven't call EstablishEncryption
    [code2=csharp]public void OnStatusChanged(StatusCode statusCode)
    {

    Console.WriteLine("PeerStatusCallback:" + statusCode.ToString());

    switch (statusCode)
    {
    case StatusCode.Connect:

    ServerConnected = true;
    break;

    case StatusCode.Disconnect:
    ServerConnected = false;
    break;

    }

    }[/code2]
  • chvetsov
    Options
    Where do you host your server?
    Did you try to restart everything?
  • Sorry everyone, i find where the problem was already and i made a stupid mistakes.
    As my internet down, the ip address have been reset so i can't log in to the server,
    my problem have been solved after i reset the ip address.
    Thank you
  • chvetsov
    Options
    greate!!!