本文整理汇总了C#中Room.GetWiredHandler方法的典型用法代码示例。如果您正苦于以下问题:C# Room.GetWiredHandler方法的具体用法?C# Room.GetWiredHandler怎么用?C# Room.GetWiredHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room.GetWiredHandler方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Repeater
public Repeater(RoomItem item, Room room)
{
Item = item;
Room = room;
Delay = 5000;
Room.GetWiredHandler().EnqueueCycle(this);
if (_mNext == 0L || _mNext < AzureEmulator.Now()) _mNext = (AzureEmulator.Now() + (Delay));
}
示例2: Repeater
public Repeater(RoomItem Item, Room Room)
{
this.mItem = Item;
this.mRoom = Room;
mDelay = 5000;
mRoom.GetWiredHandler().EnqueueCycle(this);
if (mNext == 0 || mNext < SilverwaveEnvironment.Now())
{
mNext = SilverwaveEnvironment.Now() + mDelay;
}
}
示例3: LoadFromDatabase
public void LoadFromDatabase(IQueryAdapter dbClient, Room insideRoom)
{
dbClient.setQuery("SELECT triggers_item FROM trigger_in_place WHERE original_trigger = " + this.item.Id);
DataTable dTable = dbClient.getTable();
RoomItem targetItem;
insideRoom.GetWiredHandler().conditionHandler.AddOrIgnoreRefferance(item);
foreach (DataRow dRows in dTable.Rows)
{
targetItem = insideRoom.GetRoomItemHandler().GetItem(Convert.ToUInt32(dRows[0]));
if (targetItem == null || this.items.Contains(targetItem))
continue;
this.items.Add(targetItem);
}
}
示例4: HandleDefaultSave
internal static void HandleDefaultSave(uint itemID, Room room)
{
RoomItem item = room.GetRoomItemHandler().GetItem(itemID);
if (item == null)
return;
InteractionType type = item.GetBaseItem().InteractionType;
switch (type)
{
case InteractionType.actiongivescore:
{
int points = 0;
int games = 0;
IWiredTrigger action = new GiveScore(games, points, room.GetGameManager(), itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionmoverotate:
{
MovementState movement = MovementState.none;
RotationState rotation = RotationState.none;
List<RoomItem> items = new List<RoomItem>();
int delay = 0;
IWiredTrigger action = new MoveRotate(movement, rotation, items, delay, room, room.GetWiredHandler(), itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionposreset:
{
List<RoomItem> items = new List<RoomItem>();
int delay = 0;
IWiredTrigger action = new PositionReset(items, delay, room.GetRoomItemHandler(), room.GetWiredHandler(), itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionresettimer:
{
List<RoomItem> items = new List<RoomItem>();
int delay = 0;
IWiredTrigger action = new TimerReset(room, room.GetWiredHandler(), items, delay, itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionshowmessage:
{
string message = string.Empty;
IWiredTrigger action = new ShowMessage(message, room.GetWiredHandler(), itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionteleportto:
{
List<RoomItem> items = new List<RoomItem>();
int delay = 0;
IWiredTrigger action = new TeleportToItem(room.GetGameMap(), room.GetWiredHandler(), items, delay, itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actiontogglestate:
{
List<RoomItem> items = new List<RoomItem>();
int delay = 0;
IWiredTrigger action = new ToggleItemState(room.GetGameMap(), room.GetWiredHandler(), items, delay, itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.conditionfurnishaveusers:
{
break;
}
case InteractionType.conditionstatepos:
{
break;
}
case InteractionType.conditiontimelessthan:
{
break;
}
case InteractionType.conditiontimemorethan:
//.........这里部分代码省略.........
示例5: HandleSave
internal static void HandleSave(uint itemID, Room room, ClientMessage clientMessage)
{
RoomItem item = room.GetRoomItemHandler().GetItem(itemID);
if (item == null)
return;
if (item.wiredHandler != null)
{
item.wiredHandler.Dispose();
item.wiredHandler = null;
}
InteractionType type = item.GetBaseItem().InteractionType;
switch (type)
{
case InteractionType.actiongivescore:
{
clientMessage.AdvancePointer(1);
int points = clientMessage.PopWiredInt32();
int games = clientMessage.PopWiredInt32();
IWiredTrigger action = new GiveScore(games, points, room.GetGameManager(), itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionmoverotate:
{
clientMessage.AdvancePointer(1);
MovementState movement = (MovementState)clientMessage.PopWiredInt32();
RotationState rotation = (RotationState)clientMessage.PopWiredInt32();
clientMessage.AdvancePointer(2);
int furniCount;
List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
int delay = clientMessage.PopWiredInt32();
IWiredTrigger action = new MoveRotate(movement, rotation, items, delay, room, room.GetWiredHandler(), itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionposreset:
{
clientMessage.AdvancePointer(3);
int furniCount;
List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
int delay = clientMessage.PopWiredInt32();
IWiredTrigger action = new PositionReset(items, delay, room.GetRoomItemHandler(), room.GetWiredHandler(), itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionresettimer:
{
clientMessage.AdvancePointer(3);
int furniCount;
List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
int delay = clientMessage.PopWiredInt32();
IWiredTrigger action = new TimerReset(room, room.GetWiredHandler(), items, delay, itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionshowmessage:
{
clientMessage.AdvancePointer(1);
string message = clientMessage.PopFixedString();
IWiredTrigger action = new ShowMessage(message, room.GetWiredHandler(), itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actionteleportto:
{
clientMessage.AdvancePointer(3);
int furniCount;
List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
int delay = clientMessage.PopWiredInt32();
IWiredTrigger action = new TeleportToItem(room.GetGameMap(), room.GetWiredHandler(), items, delay, itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
case InteractionType.actiontogglestate:
{
clientMessage.AdvancePointer(3);
int furniCount;
List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
//.........这里部分代码省略.........
示例6: HandleConditionSave
internal static void HandleConditionSave(uint itemID, Room room, ClientMessage clientMessage)
{
RoomItem item = room.GetRoomItemHandler().GetItem(itemID);
if (item == null)
return;
if (item.wiredHandler != null)
{
item.wiredHandler.Dispose();
item.wiredHandler = null;
}
InteractionType type = item.GetBaseItem().InteractionType;
if (type != InteractionType.conditionfurnishaveusers && type != InteractionType.conditionstatepos &&
type != InteractionType.conditiontimelessthan && type != InteractionType.conditiontimemorethan &&
type != InteractionType.conditiontriggeronfurni)
return;
clientMessage.AdvancePointer(1);
bool a = clientMessage.PopWiredBoolean();
bool b = clientMessage.PopWiredBoolean();
bool c = clientMessage.PopWiredBoolean();
clientMessage.AdvancePointer(2);
int furniCount;
List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
IWiredCondition handler = null;
switch (type)
{
case InteractionType.conditionfurnishaveusers:
{
handler = new FurniHasUser(item, items);
break;
}
case InteractionType.conditionstatepos:
{
handler = new FurniStatePosMatch(item, items);
break;
}
case InteractionType.conditiontimelessthan:
{
handler = new LessThanTimer(500, room, item);
break;
}
case InteractionType.conditiontimemorethan:
{
handler = new MoreThanTimer(500, room, item);
break;
}
case InteractionType.conditiontriggeronfurni:
{
handler = new TriggerUserIsOnFurni(item, items);
break;
}
default:
return;
}
item.wiredCondition = handler;
room.GetWiredHandler().conditionHandler.AddOrIgnoreRefferance(item);
using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
{
handler.SaveToDatabase(dbClient);
}
}
示例7: LoadWiredItem
internal static void LoadWiredItem(RoomItem item, Room room, IQueryAdapter dbClient)
{
InteractionType type = item.GetBaseItem().InteractionType;
WiredLoaderObject wiredData = WiredLoaderObject.LoadItem(item, room, dbClient);
switch (type)
{
case InteractionType.actiongivescore:
{
IWiredTrigger action = new GiveScore(0, 0, room.GetGameManager(), item, room.GetWiredHandler());
action.LoadFromWiredObject(wiredData);
HandleItemLoad(action, room.GetWiredHandler(), item);
break;
}
case InteractionType.actionmoverotate:
{
IWiredTrigger action = new MoveRotate(MovementState.none, RotationState.none,new List<RoomItem>(), 0, room, room.GetWiredHandler(), item);
action.LoadFromWiredObject(wiredData);
HandleItemLoad(action, room.GetWiredHandler(), item);
break;
}
case InteractionType.actionposreset:
{
IWiredTrigger action = new PositionReset(new List<RoomItem>(), 0, room.GetRoomItemHandler(), room.GetWiredHandler(), item);
action.LoadFromWiredObject(wiredData);
HandleItemLoad(action, room.GetWiredHandler(), item);
break;
}
case InteractionType.actionresettimer:
{
IWiredTrigger action = new TimerReset(room, room.GetWiredHandler(), new List<RoomItem>(), 0, item);
action.LoadFromWiredObject(wiredData);
HandleItemLoad(action, room.GetWiredHandler(), item);
break;
}
case InteractionType.actionshowmessage:
{
IWiredTrigger action = new ShowMessage(string.Empty, room.GetWiredHandler(), item);
action.LoadFromWiredObject(wiredData);
HandleItemLoad(action, room.GetWiredHandler(), item);
break;
}
case InteractionType.actionteleportto:
{
IWiredTrigger action = new TeleportToItem(room.GetGameMap(), room.GetWiredHandler(), new List<RoomItem>(), 0, item);
action.LoadFromWiredObject(wiredData);
HandleItemLoad(action, room.GetWiredHandler(), item);
break;
}
case InteractionType.actiontogglestate:
{
IWiredTrigger action = new ToggleItemState(room.GetGameMap(), room.GetWiredHandler(), new List<RoomItem>(), 0, item);
action.LoadFromWiredObject(wiredData);
HandleItemLoad(action, room.GetWiredHandler(), item);
break;
}
case InteractionType.actionkick:
{
IWiredTrigger action = new Kick(string.Empty, room.GetWiredHandler(), item);
action.LoadFromWiredObject(wiredData);
HandleItemLoad(action, room.GetWiredHandler(), item);
break;
}
case InteractionType.conditionfurnishaveusers:
{
IWiredCondition furniHasUsers = new FurniHasUser(item, new List<RoomItem>(), room.GetWiredHandler());
furniHasUsers.LoadFromWiredObject(wiredData);
HandleConditionLoad(furniHasUsers, item);
break;
}
case InteractionType.conditionhasfurnionfurni:
{
IWiredCondition furniHasUsers = new FurniHasFurni(item, new List<RoomItem>(), room.GetWiredHandler(), false);
furniHasUsers.LoadFromWiredObject(wiredData);
HandleConditionLoad(furniHasUsers, item);
break;
}
case InteractionType.conditionstatepos:
{
IWiredCondition furnistatepos = new FurniStatePosMatch(item, new List<RoomItem>(), room.GetWiredHandler(),false,false,false);
furnistatepos.LoadFromWiredObject(wiredData);
HandleConditionLoad(furnistatepos, item);
break;
}
case InteractionType.conditiontimelessthan:
{
IWiredCondition timeLessThan = new LessThanTimer(0, room, item, room.GetWiredHandler());
timeLessThan.LoadFromWiredObject(wiredData);
HandleConditionLoad(timeLessThan, item);
break;
//.........这里部分代码省略.........
示例8: HandleConditionSave
internal static void HandleConditionSave(uint itemID, Room room, ClientMessage clientMessage)
{
RoomItem item = room.GetRoomItemHandler().GetItem(itemID);
if (item == null)
return;
if (item.wiredHandler != null)
{
item.wiredHandler.Dispose();
item.wiredHandler = null;
}
InteractionType type = item.GetBaseItem().InteractionType;
if (type != InteractionType.conditionfurnishaveusers && type != InteractionType.conditionstatepos &&
type != InteractionType.conditiontimelessthan && type != InteractionType.conditiontimemorethan &&
type != InteractionType.conditiontriggeronfurni && type != InteractionType.conditionhasfurnionfurni)
return;
int amountOfBooleanSettings = clientMessage.ReadInt();
if (amountOfBooleanSettings > 3)
return;
int[] booleans = new int[amountOfBooleanSettings];
for (int i = 0; i < amountOfBooleanSettings; i++)
{
booleans[i] = clientMessage.ReadInt();
}
string someString = clientMessage.ReadString();
List<RoomItem> items = null;
if (ConditionPacketBuilder.NeedsFurni(type))
{
items = GetItems(clientMessage, room);
}
else
{
items = new List<RoomItem>();
}
//int furniCount;
IWiredCondition handler = null;
switch (type)
{
case InteractionType.conditionfurnishaveusers:
{
handler = new FurniHasUser(item, items, room.GetWiredHandler());
break;
}
case InteractionType.conditionstatepos:
{
handler = new FurniStatePosMatch(item, items, room.GetWiredHandler(), booleans[0] == 1, booleans[1] == 1, booleans[2] == 1);
break;
}
case InteractionType.conditiontimelessthan:
{
handler = new LessThanTimer(500, room, item, room.GetWiredHandler());
break;
}
case InteractionType.conditiontimemorethan:
{
handler = new MoreThanTimer(500, room, item, room.GetWiredHandler());
break;
}
case InteractionType.conditiontriggeronfurni:
{
handler = new TriggerUserIsOnFurni(item, items, room.GetWiredHandler());
break;
}
case InteractionType.conditionhasfurnionfurni:
{
handler = new FurniHasFurni(item, items, room.GetWiredHandler(), booleans[0] == 1);
break;
}
default:
return;
}
item.wiredCondition = handler;
room.GetWiredHandler().conditionHandler.AddOrIgnoreRefferance(item);
using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
WiredSaverHandler.UpdateInDatabase(handler, dbClient);
}
}
示例9: HandleConditionSave
internal static void HandleConditionSave(GameClient Session, uint itemID, Room room, ClientMessage clientMessage)
{
// // id, resolveIntParams, resolveStringParam, getStuffIds, resolveStuffSelectionType
RoomItem item = room.GetRoomItemHandler().GetItem(itemID);
if (item == null)
return;
if (item.wiredCondition != null)
{
item.wiredCondition.Dispose();
item.wiredCondition = null;
}
InteractionType type = item.GetBaseItem().InteractionType;
if (type != InteractionType.conditionfurnishaveusers && type != InteractionType.conditionstatepos &&
type != InteractionType.conditiontimelessthan && type != InteractionType.conditiontimemorethan &&
type != InteractionType.conditiontriggeronfurni)
return;
// Parse data
int[] intParams = new int[clientMessage.ReadInt32()];
for (int i = 0; i < intParams.Length; i++)
intParams[i] = clientMessage.ReadInt32();
string stringParam = clientMessage.ReadString();
int furniCount;
List<RoomItem> items = GetItems(clientMessage, room, out furniCount);
int stuffSelectionType = clientMessage.ReadInt32();
IWiredCondition handler = null;
switch (type)
{
case InteractionType.conditionfurnishaveusers:
{
handler = new FurniHasUser(item, items);
break;
}
case InteractionType.conditionstatepos:
{
handler = new FurniStatePosMatch(item, items);
break;
}
case InteractionType.conditiontimelessthan:
{
handler = new LessThanTimer(500, room, item);
break;
}
case InteractionType.conditiontimemorethan:
{
handler = new MoreThanTimer(500, room, item);
break;
}
case InteractionType.conditiontriggeronfurni:
{
handler = new TriggerUserIsOnFurni(item, items);
break;
}
default:
return;
}
item.wiredCondition = handler;
room.GetWiredHandler().conditionHandler.AddOrIgnoreRefferance(item);
using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
{
handler.SaveToDatabase(dbClient);
}
Session.SendMessage(new ServerMessage(Outgoing.SaveWired));
}