Пример #1
0
 private void OnCreateSuccess(CreateSuccessPacket createSuccess)
 {
     Log("Connected");
     CharId   = createSuccess.CharId;
     ObjectId = createSuccess.ObjectId;
     _plugins.ForEach(p => p.Connect(this));
 }
Пример #2
0
 private void OnCreateSuccess(Client client, CreateSuccessPacket packet)
 {
     PluginUtilities.Delay(2000,
                           () => {
         client.SendToClient(
             PluginUtilities.CreateNotification(client.ObjectId, 0x00F20A, "Welcome to Eris!"));
     });
 }
        private void OnCreateSuccess(IncomingPacket packet)
        {
            Debug.Log("Has successfully connected!");

            CreateSuccessPacket createSuccessPacket = (CreateSuccessPacket)packet;

            _playerId       = createSuccessPacket.ObjectId;
            _charId         = createSuccessPacket.CharId;
            CreateCharacter = false;
        }
Пример #4
0
        private void OnCreateSuccess(Client client, CreateSuccessPacket packet)
        {
            PluginUtils.Delay(1000, () =>
            {
                string message = "Welcome to K Relay!";
                string server  = "";
                if (GameData.GameData.Servers.Map.Where(s => s.Value.Address == client.State.ConTargetAddress).Any())
                {
                    server = GameData.GameData.Servers.Match(s => s.Address == client.State.ConTargetAddress).Name;
                }

                if (server != "")
                {
                    message += "\\n" + server;
                }

                client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, message));
            });
        }
Пример #5
0
 private void OnCreateSuccess(Client client, CreateSuccessPacket packet)
 {
     client.PlayerData = new PlayerData(packet.ObjectId, client.State.Value <MapInfoPacket>("MapInfo"));
 }
Пример #6
0
 private bool OnCreateSuccess(ref CreateSuccessPacket packet)
 {
     myObjId = packet.ObjectID;
     return(true);
 }
Пример #7
0
        protected override void OnReceive(int size, byte opcode, byte[] packet)
        {
            InPacket in_packet = InPacket.Parse((Opcode)opcode, packet);

            switch ((Opcode)opcode)
            {
            case Opcode.FAILURE:
                if (this.OnFailure != null)
                {
                    FailurePacket failure = (FailurePacket)in_packet;
                    this.OnFailure(failure.ErrorId, failure.ErrorDescription);
                }
                break;

            case Opcode.CREATE_SUCCESS:
                if (this.OnCreateSuccess != null)
                {
                    CreateSuccessPacket create_success = (CreateSuccessPacket)in_packet;
                    this.OnCreateSuccess(create_success.ObjectId, create_success.CharId);
                }
                break;

            case Opcode.TEXT:
                if (this.OnText != null)
                {
                    TextPacket text = (TextPacket)in_packet;
                    this.OnText(text.Name, text.ObjectId, text.ObjectType, text.Texture1Id, text.Texture2Id, text.NumStars, text.Recipient, text.Text, text.CleanText);
                }
                break;

            case Opcode.SHOOT:
                if (this.OnShoot != null)
                {
                    ShootPacket shoot = (ShootPacket)in_packet;
                    this.OnShoot(shoot.BulletId, shoot.OwnerId, shoot.ContainerType, shoot.StartingPosition, shoot.Angle, shoot.Damage);
                }
                break;

            case Opcode.DAMAGE:
                if (this.OnDamage != null)
                {
                    DamagePacket damage = (DamagePacket)in_packet;
                    this.OnDamage(damage.TargetId, damage.ConditionEffect, damage.DamageAmount, damage.BulletId, damage.ObjectId);
                }
                break;

            case Opcode.UPDATE:
                if (this.OnUpdate != null)
                {
                    UpdatePacket update = (UpdatePacket)in_packet;
                    this.OnUpdate(update.Tiles, update.NewObjects, update.Drops);
                }
                break;

            case Opcode.NOTIFICATION:
                if (this.OnNotification != null)
                {
                    NotificationPacket notification = (NotificationPacket)in_packet;
                    this.OnNotification(notification.ObjectId, notification.Text);
                }
                break;

            case Opcode.NEW_TICK:
                if (this.OnNewTick != null)
                {
                    NewTickPacket new_tick = (NewTickPacket)in_packet;
                    this.OnNewTick(new_tick.TickId, new_tick.TickTime, new_tick.Statuses);
                }
                break;

            case Opcode.MAPINFO:
                if (this.OnMapInfo != null)
                {
                    MapInfoPacket map_info = (MapInfoPacket)in_packet;
                    this.OnMapInfo(map_info.Width, map_info.Height, map_info.Name, map_info.FP, map_info.Background, map_info.AllowPlayerTeleport, map_info.ShowDisplays, map_info.ExtraXml);
                }
                break;
            }
        }