Beispiel #1
0
 protected virtual NeutronPlayer[] OnCustomMatchmakingTo(NeutronPlayer player, MatchmakingTo matchmakingTo)
 {
     switch (matchmakingTo)
     {
     default:
         LogHelper.Error("Broadcast Packet not implemented! " + matchmakingTo);
         return(null);
     }
 }
Beispiel #2
0
        private async void Internal_OnPlayerJoinedRoom(NeutronPlayer player, NeutronRoom room)
        {
            await NeutronSchedule.ScheduleTaskAsync(() =>
            {
                MakeRoomContainer(room);
            });

            OnPlayerJoinedRoom(player, room);
        }
Beispiel #3
0
 /// <summary>
 ///* Envia o estado da autenticação ao seu usuário.
 /// </summary>
 /// <param name="user">* O usuário a ser autenticado.</param>
 /// <param name="authStatus">* O estado da autenticação</param>
 /// <returns></returns>
 protected bool OnAuth(NeutronPlayer user, bool authStatus)
 {
     user.Properties = string.IsNullOrEmpty(user.Properties) ? "{\"Neutron\":\"Neutron\"}" : user.Properties;
     using (NeutronStream stream = Neutron.PooledNetworkStreams.Pull())
     {
         NeutronStream.IWriter writer = stream.Writer;
         writer.WritePacket((byte)Packet.AuthStatus);
         writer.Write(user.Properties);
         writer.Write(authStatus);
         user.Write(writer);
     }
     return(authStatus);
 }
Beispiel #4
0
 private void MakeVirtualOwner(INeutronMatchmaking matchmaking, NeutronChannel channel, NeutronRoom room)
 {
     if (matchmaking.Owner != null)
     {
         LogHelper.Error("Matchmaking already has an owner!");
     }
     else
     {
         //* Não pode aproveitar o Neutron.Server.Player? não, não podemos compartilhar a mesma instância pra vários matchmaking, um jogador só pode está em um Matchmaking ao mesmo tempo.
         NeutronPlayer player = PlayerHelper.MakeTheServerPlayer();
         player.Channel     = channel;
         player.Room        = room;
         player.Matchmaking = MatchmakingHelper.Matchmaking(player);
         matchmaking.Owner  = player; //! reforço: um jogador só pode está em um Matchmaking ao mesmo tempo.
     }
 }
Beispiel #5
0
 protected virtual void OnCustomTarget(NeutronPlayer player, NeutronPacket packet, TargetTo targetTo, NeutronPlayer[] players)
 {
     throw new NotImplementedException("Ué cara???");
 }
Beispiel #6
0
 protected virtual void OnPlayerLeftRoom(NeutronPlayer player)
 {
 }
Beispiel #7
0
 protected virtual async Task <bool> OnAuthentication(NeutronPlayer player, Authentication authentication)
 {
     return(await Task.Run(() => true));
 }
Beispiel #8
0
#pragma warning disable UNT0006
        protected virtual void OnPlayerConnected(NeutronPlayer player)
#pragma warning restore UNT0006
        {
        }
Beispiel #9
0
 protected virtual void OnPlayerConnected(NeutronPlayer player, bool isMine, Neutron neutron)
 {
 }
Beispiel #10
0
 protected virtual void OnRoomPropertiesChanged(NeutronPlayer player, string properties, bool isMine, Neutron neutron)
 {
 }
Beispiel #11
0
 protected virtual void OnPlayerJoinedChannel(NeutronChannel channel, NeutronPlayer player, bool isMine, Neutron neutron)
 {
 }
Beispiel #12
0
 protected virtual void OnPlayerCustomPacketReceived(NeutronStream.IReader reader, NeutronPlayer player, byte packetId, Neutron neutron)
 {
 }
Beispiel #13
0
#pragma warning disable UNT0006
        protected virtual void OnPlayerDisconnected(NeutronPlayer player)
#pragma warning restore UNT0006
        {
            LogHelper.Info($"The Player [{player.StateObject.TcpRemoteEndPoint}] Has been disconnected from server.");
        }
Beispiel #14
0
 protected virtual bool OnPlayerNicknameChanged(NeutronPlayer player, string nickname)
 {
     return(true);
 }
Beispiel #15
0
 protected virtual bool OnPlayerPropertiesChanged(NeutronPlayer player, string properties)
 {
     return(true);
 }
Beispiel #16
0
 protected virtual bool OnPlayerCreatedRoom(NeutronPlayer player, NeutronRoom room)
 {
     return(true);
 }
Beispiel #17
0
 protected virtual void OnCheatDetected(NeutronPlayer player, string name)
 {
     LogHelper.Info($"Usando hack porraaaaaaaa -> {player.Nickname}");
 }
Beispiel #18
0
 protected virtual void OnPlayerNicknameChanged(NeutronPlayer player, string nickname, bool isMine, Neutron neutron)
 {
 }
Beispiel #19
0
 protected virtual void OnPlayerJoinedRoom(NeutronPlayer player, NeutronRoom room)
 {
 }
Beispiel #20
0
 protected virtual void OnPlayerDisconnected(string reason, NeutronPlayer player, bool isMine, Neutron neutron)
 {
 }
Beispiel #21
0
 protected virtual void OnPlayerLeftChannel(NeutronPlayer player)
 {
 }
Beispiel #22
0
 protected virtual void OnPlayerCreatedRoom(NeutronRoom room, NeutronPlayer player, bool isMine, Neutron neutron)
 {
 }
Beispiel #23
0
 protected virtual void OnPlayerJoinedChannel(NeutronPlayer player)
 {
 }
Beispiel #24
0
 protected virtual void OnMessageReceived(string message, NeutronPlayer player, bool isMine, Neutron neutron)
 {
 }
Beispiel #25
0
 protected virtual void OnPlayerDestroyed(NeutronPlayer player)
 {
 }
Beispiel #26
0
 /// <summary>
 ///* Ends a gRPC(Global Remote Procedure Call) service call.<br/>
 ///* (from server-side) use this overload to send from server to client.
 /// </summary>
 /// <param name="id">The id of the gRPC service.</param>
 /// <param name="parameters">The parameters that will be sent with the service.</param>
 /// <param name="protocol">The protocol used to send the service.</param>
 /// <param name="player">The player that will send the service.</param>
 public void End_gRPC(byte id, NeutronStream parameters, Protocol protocol, NeutronPlayer player)
 {
     Server.End_gRPC(id, parameters, protocol, player);
 }
Beispiel #27
0
 protected virtual bool OnMessageReceived(NeutronPlayer player, string message)
 {
     return(true);
 }