summaryrefslogtreecommitdiff
path: root/NET/worlds/network/roomChangeCmd.java
blob: 7aaa490febc3fea3db460aa3abb753b8de6dd0de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*     */ package NET.worlds.network;
/*     */ 
/*     */ import NET.worlds.scape.Drone;
/*     */ import NET.worlds.scape.Room;
/*     */ import java.io.IOException;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class roomChangeCmd
/*     */   extends receivedNetPacket
/*     */ {
/*     */   public static final byte ROOMCHNGCMD = 5;
/*     */   protected int _roomID;
/*     */   protected short _x;
/*     */   protected short _y;
/*     */   protected short _z;
/*     */   protected short _direction;
/*     */   
/*     */   public roomChangeCmd()
/*     */   {
/*  58 */     this._commandType = 5;
/*     */   }
/*     */   
/*     */   public roomChangeCmd(Room room, short x, short y, short z, short direction) {
/*  62 */     super(null, 5);
/*  63 */     this._roomID = room.getNetworkRoom().getRoomID();
/*  64 */     assert (this._roomID != 0);
/*  65 */     this._x = x;
/*  66 */     this._y = y;
/*  67 */     this._z = z;
/*  68 */     this._direction = direction;
/*     */   }
/*     */   
/*     */   void parseNetData(ServerInputStream data) throws IOException
/*     */   {
/*  73 */     this._roomID = data.readUnsignedShort();
/*  74 */     this._x = data.readShort();
/*  75 */     this._y = data.readShort();
/*  76 */     this._z = data.readShort();
/*  77 */     this._direction = data.readShort();
/*     */   }
/*     */   
/*     */   int packetSize()
/*     */   {
/*  82 */     return 10 + super.packetSize();
/*     */   }
/*     */   
/*     */   void send(ServerOutputStream o) throws IOException
/*     */   {
/*  87 */     super.send(o);
/*  88 */     o.writeShort(this._roomID);
/*  89 */     o.writeShort(this._x);
/*  90 */     o.writeShort(this._y);
/*  91 */     o.writeShort(this._z);
/*  92 */     o.writeShort(this._direction);
/*     */   }
/*     */   
/*     */   void process(WorldServer _serv) throws Exception
/*     */   {
/*  97 */     NetworkObject o = _serv.getObject(this._objID);
/*  98 */     if ((o instanceof Drone)) {
/*  99 */       assert (this._roomID != 0);
/* 100 */       Room newroom = null;
/* 101 */       NetworkRoom netroom = _serv.getNetworkRoom(this._roomID);
/* 102 */       if (netroom != null) {
/* 103 */         newroom = netroom.getRoom();
/*     */       }
/*     */       
/* 106 */       this._direction = ((short)(90 - this._direction));
/*     */       
/* 108 */       this._direction = ((short)(360 - this._direction));
/*     */       
/*     */ 
/* 111 */       ((Drone)o).roomChange(newroom, this._x, this._y, this._z, this._direction);
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */   public String toString(WorldServer serv)
/*     */   {
/* 118 */     return 
/* 119 */       "ROOMCHNG " + this._objID.toString(serv) + " in " + this._roomID + " @ " + this._x + "," + this._y + "," + this._z + "," + this._direction;
/*     */   }
/*     */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\roomChangeCmd.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */