Ir para conteúdo

joao marcos domician

Membro
  • Registro em

  • Última visita

  1. joao marcos domician alterou sua foto pessoal
  2. .Qual servidor ou website você utiliza como base? Otpokémon Qual o motivo deste tópico? Erro de PHP Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: 1. <?php 2. 3. class Character extends Controller { 4. function index() { 5. parent::Controller(); 6. } 7. 8. function _characterExists($name) { 9. $this->load->model("character_model"); 10. if($this->character_model->characterExists($name)) { 11. $this->form_validation->set_message('_characterExists', 'This character name already exists, please choose another one!'); 12. return false; 13. } 14. else 15. return true; 16. } 17. 18. function _checkCity($id) { 19. $this->config->load('create_character.php'); 20. if(!array_key_exists($id, $this->config->item('cities'))) { 21. $this->form_validation->set_message('_checkCity', 'Unknown City'); 22. return false; 23. } 24. else 25. return true; 26. } 27. 28. function _checkWorld($id) { 29. $this->config->load('create_character.php'); 30. if(!array_key_exists($id, $this->config->item('worlds'))) { 31. $this->form_validation->set_message('_checkWorld', 'Unknown World'); 32. return false; 33. } 34. else 35. return true; 36. } 37. 38. function _checkVocation($id) { 39. $this->config->load('create_character.php'); 40. if(!array_key_exists($id, $this->config->item('vocations'))) { 41. $this->form_validation->set_message('_checkVocation', 'Unknown Vocation'); 42. return false; 43. } 44. else 45. return true; 46. } 47. 48. function _checkSex($id) { 49. if($id != 0 and $id != 1) { 50. $this->form_validation->set_message('_checkSex', 'Unknown Sex'); 51. return false; 52. } 53. else 54. return true; 55. } 56. 57. function _checkDelay() { 58. global $config; 59. if(!isset($_SESSION['characterDelay'])) $_SESSION['characterDelay'] = 0; 60. if($config['characterDelay']) { 61. if(@(time()-$_SESSION['characterDelay']) > 240) { 62. return true; 63. } 64. else { 65. $this->form_validation->set_message('_checkDelay', 'You cannot create another character just after another. Please wait few minutes.'); 66. return false; 67. } 68. } 69. else 70. return true; 71. } 72. 73. function _validName($name) { 74. require("config.php"); 75. $name = explode(" ", $name); 76. foreach($name as $unit) { 77. if(in_array(strtolower($unit), $config['invalidNameTags'])) { 78. $this->form_validation->set_message('_validName', 'Invalid Name'); 79. return false; 80. } 81. else if(strlen($unit) == 1) { 82. $this->form_validation->set_message('_validName', 'Invalid Name'); 83. return false; 84. } 85. else 86. continue; 87. } 88. } 89. 90. // Function which make the player more real by tatu hunter 91. // Eg: elder'Druid = Elder'Druid 92. // elder'druid = Elder'druid 93. // druid theMaster = Druid themaster 94. function strFirst($name) { 95. $name = explode(' ', trim($name)); 96. for($i=0, $t = sizeof($name); $i<$t; ++$i) 97. for($j=0, $l=strlen($name[$i]); $j<$l; ++$j) 98. !$j ? 99. ($name[$i][$j] = !$i ? ($name[$i][$j] == strtoupper($name[$i][$j]) ? $name[$i][$j] : strtoupper($name[$i][$j])): $name[$i][$j]) : 100. ($name[$i][$j] = ($name[$i][$j-1] == '\'' ? $name[$i][$j] : 101. strtolower($name[$i][$j]))); 102. 103. $ret = ''; 104. foreach($name as $k) 105. $ret .= $k . ' '; 106. 107. return trim($ret); 108. } 109. 110. function create_character($ajax = 0) { 111. require_once("system/application/config/create_character.php"); 112. global $config; 113. global $ide; 114. $data['worlds'] = $config['worlds']; 115. $data['cities'] = $config['cities']; 116. $data['vocations'] = $config['vocations']; 117. $this->load->model("character_model"); 118. $count = $this->character_model->getCount(); 119. if($count >= $config['maxCharacters'] && $ajax == 1) exit; 120. if($count >= $config['maxCharacters']) $ide->redirect(WEBSITE."/index.php/account/index/3"); 121. $this->load->helper('form'); 122. $this->load->library('form_validation'); 123. if($_POST) { 124. $_POST['name'] = trim(ucwords(strtolower(decodeString($_POST['name'])))); 125. $this->form_validation->set_rules('name', 'Player Name', "required|min_length[3]|max_length[20]|nickname|callback__characterExists|callback__validName|callback__checkDelay"); 126. $this->form_validation->set_rules('city', 'City', 'required|integer|callback__checkCity'); 127. $this->form_validation->set_rules('world', 'World', 'required|integer|callback__checkWorld'); 128. $this->form_validation->set_rules('vocation', 'Vocation', 'required|integer|callback__checkVocation'); 129. $this->form_validation->set_rules('sex', 'Sex', 'required|integer|callback__checkSex'); 130. 131. if($this->form_validation->run() == true) { 132. $ide = new IDE; 133. $char_to_copy_name = $config['newchar_vocations'][$_POST['world']][$_POST['vocation']]; 134. $ots = POT::getInstance(); 135. $ots->connect(POT::DB_MYSQL, connection()); 136. $char_to_copy = new OTS_Player(); 137. $char_to_copy->find($char_to_copy_name); 138. $this->load->model("character_model"); 139. /* This code (Most of it actually) has been taken from Gesior AAC. */ 140. $account_logged = $ots->createObject('Account'); 141. $account_logged->load($this->character_model->getAccountID()); 142. if(!$char_to_copy->isLoaded()) { show_error('Sample character could not be found!'); } 143. if($_POST['sex'] == "0") 144. $char_to_copy->setLookType(136); 145. $player = $ots->createObject('Player'); 146. $player->setName($this->strFirst($_POST['name'])); 147. $player->setAccount($account_logged); 148. $player->setWorld($_POST['world']); 149. $player->setGroup($char_to_copy->getGroup()); 150. $player->setSex($_POST['sex']); 151. $player->setVocation($char_to_copy->getVocation()); 152. $player->setConditions($char_to_copy->getConditions()); 153. $player->setRank($char_to_copy->getRank()); 154. $player->setLookAddons($char_to_copy->getLookAddons()); 155. $player->setTownId($_POST['city']); 156. $player->setExperience($char_to_copy->getExperience()); 157. $player->setLevel($char_to_copy->getLevel()); 158. $player->setMagLevel($char_to_copy->getMagLevel()); 159. $player->setHealth($char_to_copy->getHealth()); 160. $player->setHealthMax($char_to_copy->getHealthMax()); 161. $player->setMana($char_to_copy->getMana()); 162. $player->setManaMax($char_to_copy->getManaMax()); 163. $player->setManaSpent($char_to_copy->getManaSpent()); 164. $player->setSoul($char_to_copy->getSoul()); 165. $player->setDirection($char_to_copy->getDirection()); 166. $player->setLookBody($char_to_copy->getLookBody()); 167. $player->setLookFeet($char_to_copy->getLookFeet()); 168. $player->setLookHead($char_to_copy->getLookHead()); 169. $player->setLookLegs($char_to_copy->getLookLegs()); 170. $player->setLookType($char_to_copy->getLookType()); 171. $player->setCap($char_to_copy->getCap()); 172. $player->setPosX($startPos['x']); 173. $player->setPosY($startPos['y']); 174. $player->setPosZ($startPos['z']); 175. $player->setLossExperience($char_to_copy->getLossExperience()); 176. $player->setLossMana($char_to_copy->getLossMana()); 177. $player->setLossSkills($char_to_copy->getLossSkills()); 178. $player->setLossItems($char_to_copy->getLossItems()); 179. $player->setLossContainers($char_to_copy->getLossContainers()); 180. $player->save(); 181. $_SESSION['characterDelay'] = time(); 182. unset($player); 183. $player = $ots->createObject('Player'); 184. $player->find($_POST['name']); 185. if($player->isLoaded()) 186. { 187. $player->setCustomField('world_id', (int) $_POST['world']); 188. $player->setSkill(0,$char_to_copy->getSkill(0)); 189. $player->setSkill(1,$char_to_copy->getSkill(1)); 190. $player->setSkill(2,$char_to_copy->getSkill(2)); 191. $player->setSkill(3,$char_to_copy->getSkill(3)); 192. $player->setSkill(4,$char_to_copy->getSkill(4)); 193. $player->setSkill(5,$char_to_copy->getSkill(5)); 194. $player->setSkill(6,$char_to_copy->getSkill(6)); 195. $player->save(); 196. $SQL = POT::getInstance()->getDBHandle(); 197. $loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId().""); 198. foreach($loaded_items_to_copy as $save_item) 199. $SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');"); 200. 201. if($ajax == 0) 202. $ide->redirect(WEBSITE.'/index.php/account/index/1'); 203. else 204. $ide->criticalRedirect(WEBSITE.'/index.php/account/index/1'); 205. } 206. } 207. } 208. if($ajax == 1) { 209. error(validation_errors()); 210. $ide->system_stop(); 211. } 212. else 213. $this->load->view('create_character', $data); 214. } 215. 216. public function view($name = null) { 217. global $config; 218. if(!@is_array($_SESSION['sCharacters'])) 219. $_SESSION['sCharacters'] = array(); 220. $ide = new IDE; 221. if(!empty($name)) { 222. $name = decodeString($name); 223. $data['character'] = $name; 224. $ots = POT::getInstance(); 225. $ots->connect(POT::DB_MYSQL, connection()); 226. $player = $ots->createObject('Player'); 227. $player->find($name); 228. if(!$player->isLoaded()) { 229. $ide->redirect("../../character/view/"); 230. } 231. else { 232. if(!in_multiarray($name, $_SESSION['sCharacters'])) { 233. array_unshift($_SESSION['sCharacters'], array("name"=>$name, "time"=>time())); 234. if(count($_SESSION['sCharacters']) > $config['characterSearchLimit']) 235. array_pop($_SESSION['sCharacters']); 236. } 237. 238. $data['player'] = $player; 239. $data['account'] = $player->getAccount(); 240. } 241. $this->load->view('view_character.php', $data); 242. } 243. else { 244. $this->load->helper("form"); 245. if($_POST) { 246. $name = decodeString($_POST['name']); 247. $ots = POT::getInstance(); 248. $ots->connect(POT::DB_MYSQL, connection()); 249. $player = new OTS_Player(); 250. $player->find($name); 251. if($player->isLoaded()) { 252. $ide->redirect("../character/view/$name"); 253. } 254. else { 255. error("$name could not be found."); 256. } 257. 258. } 259. $this->load->view('character_search.php'); 260. } 261. 262. } 263. 264. public function online() { 265. $this->load->helper('form'); 266. $this->load->model("character_model"); 267. $data['players'] = $this->character_model->getPlayersOnline(); 268. $this->load->view("online_players.php", $data); 269. } 270. 271. public function clearHistory() { 272. global $ide; 273. $_SESSION['sCharacters'] = array(); 274. echo "History Cleared!"; 275. $ide->system_stop(); 276. } 277. } 278. 279. ?> Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
  3. Bom gente (Desculpe se postei meu tópico no lugar errado eu sou novo aqui), eu estou com um pokétibia online que venho editando á um tempo e resolvi deixa-lo online porém eu não sei como deixar ele 24 horas online sem deixar meu computador ligado, existe alguma outra forma além dessa de deixar o servidor online sem precisar gastar tanta energia com o computador ligado o dia inteiro? desde já agradeço!
  4. Fodastico Man Tem Como Você Editar o PokeZOT pra Parecer Pokepro Se nao conhece ta ai o site www.pokemon-pro.com Mano Tem Como Você criar Um OTServer Igualzinho a do Pokepro ????Tipo Com todos os Pokémons,Itens Etc..

Informação Importante

Confirmação de Termo