示例#1
0
    void Start()
    {
        NetworkSocket.Initialise(25001, 500); // Initialise un socket au port 25000 avec 500 connexions au max.
        InitialiseModules();
        Activate();
        BloodAndBileEngine.NetworkCommandManager.Initialize();
        InputHandlers = new BloodAndBileEngine.InputHandlersManager();
        InputHandlers.Add("Activate", (object[] parameters) => Activate());
        InputHandlers.Add("Deactivate", (object[] parameters) => Deactivate());

        PlayerControlManager = new BloodAndBileEngine.PlayerControlCommandManager();
        PlayerControlManager.SetExecuteLocally();
    }
示例#2
0
    public void Activate()
    {
        if (Activated)
        {
            BloodAndBileEngine.Debugger.Log("Le module MasterServerConnectionModule est déjà activé !", UnityEngine.Color.red); return;
        }

        Activated = true;
        InputHandlers.Add("SetMasterServerInfos", SetMasterServerInfos);
        InputHandlers.Add("LoginToMasterServer", ConnectToMasterServer);

        NetworkHandlers = new BloodAndBileEngine.Networking.HandlersManager();
        NetworkHandlers.Add <BloodAndBileEngine.Networking.NetworkMessages.ConditionCheckResponseMessage>(60001, OnAuthentificationResponseReceived);

        BloodAndBileEngine.Networking.NetworkSocket.RegisterOnConnectionEstablishedCallback(OnConnectionEstablished);
        BloodAndBileEngine.Networking.NetworkSocket.RegisterOnDisconnectionCallback(OnConnectionLost);
    }
示例#3
0
 public void OnEntry()
 {
     NetworkHandlers = new BloodAndBileEngine.Networking.HandlersManager();
     InputHandlers   = new InputHandlersManager();
     BloodAndBileEngine.Networking.NetworkSocket.RegisterOnDisconnectionCallback(OnDisconnected);
     InputHandlers.Add("StartMatchmaking", StartMatchmaking);
     if (ClientConnectionsManager.GetConnectionIDFromName("MasterServer") == -1)
     {
         BloodAndBileEngine.Debugger.Log("Pas de connexion à un Master Server ! Retour au LoginState...", UnityEngine.Color.red);
         Client.ChangeState(new LoginState());
     }
 }