我回来了,这次在玩游戏时遇到了一个问题。所以我正在追踪一些数据包,并在我的来源上复制了一份。所以,函数:
function handleBakeryStateUpdate( $data, $str, $clientid )
{
$client = $this->clients[ $clientid ]; //$client SHOULD ALWAYS BE A MEMBER OF THE CLIENT CLASS!
$this->sendToRoom( $client->extRoomID, "%xt%barsu%" . $client->ID . "%"{'CurrentStation':'IngredientsStation','IngredientsStation':[{'IngredientType':'Eggs','TotalRequired':1,'CurrentCount':0},{'IngredientType':'Milk','TotalRequired':1,'CurrentCount':0},{'IngredientType':'Hay','TotalRequired':1,'CurrentCount':0},{'IngredientType':'Flour','TotalRequired':1,'CurrentCount':0}],'CheerStation':{'CheerCapacity':7,'CurrentCheerCount':7,'Emote':7},'MultiplierStation':{'Counter':-1,'Multiplier':'Small'}}"%" );
}
该数据包应该发送一堆东西,并且在该数据包中它具有{和}。而且,另一个问题是该函数也有 { 和 }。所以它给了我:
PHP Parse error: syntax error, unexpected '{' in ...
我怎样才能解决这个问题?
更多信息:它发送的数据包是这样的:
{'CurrentStation':'IngredientsStation','IngredientsStation':[{'IngredientType':'Eggs','TotalRequired':1,'CurrentCount':0},{'IngredientType':'Milk','TotalRequired':1,'CurrentCount':0},{'IngredientType':'Hay','TotalRequired':1,'CurrentCount':0},{'IngredientType':'Flour','TotalRequired':1,'CurrentCount':0}],'CheerStation':{'CheerCapacity':7,'CurrentCheerCount':7,'Emote':7},'MultiplierStation':{'Counter':-1,'Multiplier':'Small'}}
谢谢你。