[Sangokushi-svn] [SVN_Comitted] [459] server.ver.0.1.5

OpenSangokushi commit ML sango****@lists*****
2010年 11月 6日 (土) 00:44:59 JST


Revision: 459
          http://sourceforge.jp/projects/sangokushi/svn/view?view=rev&revision=459
Author:   hryksbt
Date:     2010-11-06 00:44:59 +0900 (Sat, 06 Nov 2010)

Log Message:
-----------
server.ver.0.1.5

Added Paths:
-----------
    tags/Ver.0.1.5/
    tags/Ver.0.1.5/server/
    tags/Ver.0.1.5/server/DB作成手順.txt
    tags/Ver.0.1.5/server/databaseSQL.txt
    tags/Ver.0.1.5/server/dump.sql
    tags/Ver.0.1.5/server/grantSQL.txt
    tags/Ver.0.1.5/server/server_php/
    tags/Ver.0.1.5/server/server_php/AI.php
    tags/Ver.0.1.5/server/server_php/battleCalc.php
    tags/Ver.0.1.5/server/server_php/checkLib.php
    tags/Ver.0.1.5/server/server_php/dbparam.inc
    tags/Ver.0.1.5/server/server_php/dbutil.php
    tags/Ver.0.1.5/server/server_php/entryNewUser.php
    tags/Ver.0.1.5/server/server_php/getAICharParam.php
    tags/Ver.0.1.5/server/server_php/getBattleResult.php
    tags/Ver.0.1.5/server/server_php/getIniUserParam.php
    tags/Ver.0.1.5/server/server_php/getMapInfo.php
    tags/Ver.0.1.5/server/server_php/getRoomInfo.php
    tags/Ver.0.1.5/server/server_php/getRoomStatus.php
    tags/Ver.0.1.5/server/server_php/getRoomTurnCount.php
    tags/Ver.0.1.5/server/server_php/getUserStatus.php
    tags/Ver.0.1.5/server/server_php/getcountry.php
    tags/Ver.0.1.5/server/server_php/index.php
    tags/Ver.0.1.5/server/server_php/login.php
    tags/Ver.0.1.5/server/server_php/main.php
    tags/Ver.0.1.5/server/server_php/sessionException.php
    tags/Ver.0.1.5/server/server_php/setBattleInfo.php
    tags/Ver.0.1.5/server/server_php/setUserEntryRoom.php
    tags/Ver.0.1.5/server/server_php/setUserExitRoom.php
    tags/Ver.0.1.5/server/server_php/sysparam.inc
    tags/Ver.0.1.5/server/server_php/table_t_login.txt
    tags/Ver.0.1.5/server/server_php/turntimer.php
    tags/Ver.0.1.5/server/三国志サーバインストール手順_CentOS5_32.txt
    tags/Ver.0.1.5/server/三国志サーバインストール手順_CentOS5_64.txt
    tags/Ver.0.1.5/server.ver.0.1.5.tar.gz

Added: tags/Ver.0.1.5/server/DB作成手順.txt
===================================================================
--- tags/Ver.0.1.5/server/DB作成手順.txt	                        (rev 0)
+++ tags/Ver.0.1.5/server/DB作成手順.txt	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,30 @@
+○三国志データベース作成手順
+
+	初期データベースを作成する手順です
+	サーバにMySQLがインストールされていることが前提になります。(初期設定済み)
+	基本的にはMySQLにログインしてSQLを実行し、dumpからリストアするだけです。
+	ファイルで実行でなくコピペで実行します。
+
+■初期データベース作成
+
+mysql -u root -p
+
+・データベース作成
+databaseSQL.txtを開いて中のSQLをコピー → コンソールにペースト → 実行
+(改行コードも一緒にコピーすると勝手に実行されます。)
+
+・データベース確認
+mysql>show databases;
+
+o_sangokushi ができていることを確認
+
+・データベースユーザ作成(PHPユーザ)
+grantSQL.txtを開いて中のSQLをコピー → コンソールにペースト → 実行
+(改行コードも一緒にコピーすると勝手に実行されます。)
+
+・データベースユーザ確認
+mysql> SHOW GRANTS FOR 'phpuser'@'localhost';
+mysql> quit
+
+・マスターデータ投入
+mysql -u root -pパスワード < dump.sql

Added: tags/Ver.0.1.5/server/databaseSQL.txt
===================================================================
--- tags/Ver.0.1.5/server/databaseSQL.txt	                        (rev 0)
+++ tags/Ver.0.1.5/server/databaseSQL.txt	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,3 @@
+
+CREATE SCHEMA IF NOT EXISTS `o_sangokushi` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
+

Added: tags/Ver.0.1.5/server/dump.sql
===================================================================
--- tags/Ver.0.1.5/server/dump.sql	                        (rev 0)
+++ tags/Ver.0.1.5/server/dump.sql	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,358 @@
+-- MySQL dump 10.13  Distrib 5.1.44, for unknown-linux-gnu (x86_64)
+--
+-- Host: localhost    Database: o_sangokushi
+-- ------------------------------------------------------
+-- Server version	5.1.44-log
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `t_AICharacter`
+--
+
+DROP TABLE IF EXISTS `t_AICharacter`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_AICharacter` (
+  `charID` smallint(5) unsigned NOT NULL,
+  `charName` varchar(40) DEFAULT NULL,
+  `charType` varchar(1) DEFAULT NULL,
+  `countryID` smallint(5) unsigned DEFAULT NULL,
+  `paramID` smallint(5) unsigned DEFAULT NULL,
+  `lastUpdateDate` datetime DEFAULT NULL,
+  PRIMARY KEY (`charID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_AICharacter`
+--
+
+LOCK TABLES `t_AICharacter` WRITE;
+/*!40000 ALTER TABLE `t_AICharacter` DISABLE KEYS */;
+INSERT INTO `t_AICharacter` VALUES (1,'曹操','s',1,101,'2010-05-12 20:29:06'),(2,'曹丕','b',1,102,'2010-05-12 20:29:06'),(3,'郭嘉','b',1,103,'2010-05-12 20:29:06'),(4,'荀彧','b',1,104,'2010-05-12 20:29:06'),(5,'荀攸','b',1,105,'2010-05-12 20:29:06'),(6,'程昱','b',1,106,'2010-05-12 20:29:06'),(7,'賈詡','b',1,107,'2010-05-12 20:29:06'),(8,'司馬懿','b',1,108,'2010-05-12 20:29:06'),(9,'徐庶','b',1,109,'2010-05-12 20:29:06'),(10,'許楮','b',1,110,'2010-05-12 20:29:06'),(11,'夏侯惇','b',1,111,'2010-05-12 20:29:06'),(12,'夏侯淵','b',1,112,'2010-05-12 20:29:06'),(13,'曹仁','b',1,113,'2010-05-12 20:29:06'),(14,'曹洪','b',1,114,'2010-05-12 20:29:06'),(15,'楽進','b',1,115,'2010-05-12 20:29:06'),(16,'李典','b',1,116,'2010-05-12 20:29:06'),(17,'張遼','b',1,117,'2010-05-12 20:29:06'),(18,'徐晃','b',1,118,'2010-05-12 20:29:06'),(19,'張郃','b',1,119,'2010-05-12 20:29:06'),(20,'于禁','b',1,120,'2010-05-12 20:29:06'),(21,'龐徳','b',1,121,'2010-05-12
  20:29:06'),(22,'劉備','s',3,122,'2010-05-12 20:29:06'),(23,'諸葛亮','b',3,123,'2010-05-12 20:29:06'),(24,'龐統','b',3,124,'2010-05-12 20:29:06'),(25,'法正','b',3,125,'2010-05-12 20:29:06'),(26,'馬良','b',3,126,'2010-05-12 20:29:06'),(27,'関羽','b',3,127,'2010-05-12 20:29:06'),(28,'張飛','b',3,128,'2010-05-12 20:29:06'),(29,'馬超','b',3,129,'2010-05-12 20:29:06'),(30,'黄忠','b',3,130,'2010-05-12 20:29:06'),(31,'趙雲','b',3,131,'2010-05-12 20:29:06'),(32,'魏延','b',3,132,'2010-05-12 20:29:06'),(33,'馬岱','b',3,133,'2010-05-12 20:29:07'),(34,'姜維','b',3,134,'2010-05-12 20:29:07'),(35,'関平','b',3,135,'2010-05-12 20:29:07'),(36,'孟達','b',3,136,'2010-05-12 20:29:07'),(37,'劉封','b',3,137,'2010-05-12 20:29:07'),(38,'廖化 ','b',3,138,'2010-05-12 20:29:07'),(39,'周倉','b',3,139,'2010-05-12 20:29:07'),(40,'厳顔','b',3,140,'2010-05-12 20:29:07'),(41,'麋芳','b',3,141,'2010-05-12 20:29:07'),(42,'李厳','b',3,142,'2010-05-12 20:29:07'),(43,'å­
 «æ¨©','s',2,143,'2010-05-12 20:29:07'),(44,'孫尚香','b',2,144,'2010-05-12 20:29:07'),(45,'周喩','b',2,145,'2010-05-12 20:29:07'),(46,'陸遜','b',2,146,'2010-05-12 20:29:07'),(47,'å‘‚è’™','b',2,147,'2010-05-12 20:29:07'),(48,'魯粛','b',2,148,'2010-05-12 20:29:07'),(49,'虞翻','b',2,149,'2010-05-12 20:29:07'),(50,'程普','b',2,150,'2010-05-12 20:29:07'),(51,'太史慈','b',2,151,'2010-05-12 20:29:07'),(52,'甘寧','b',2,152,'2010-05-12 20:29:07'),(53,'黄蓋','b',2,153,'2010-05-12 20:29:07'),(54,'韓当','b',2,154,'2010-05-12 20:29:07'),(55,'周泰','b',2,155,'2010-05-12 20:29:07'),(56,'蒋欽','b',2,156,'2010-05-12 20:29:07'),(57,'凌操','b',2,157,'2010-05-12 20:29:07'),(58,'凌統','b',2,158,'2010-05-12 20:29:07'),(59,'朱治','b',2,159,'2010-05-12 20:29:07'),(60,'徐盛','b',2,160,'2010-05-12 20:29:07'),(61,'陳武','b',2,161,'2010-05-12 20:29:07'),(62,'董襲','b',2,162,'2010-05-12 20:29:07'),(63,'朱然','b',2,163,'2010-05-12 20:29:07');
+/*!40000 ALTER TABLE `t_AICharacter` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_battle`
+--
+
+DROP TABLE IF EXISTS `t_battle`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_battle` (
+  `battleID` int(8) unsigned NOT NULL,
+  `roomID` smallint(5) unsigned DEFAULT NULL,
+  `userID` varchar(10) DEFAULT NULL,
+  `userName` varchar(40) DEFAULT NULL,
+  `countryID` smallint(5) unsigned NOT NULL,
+  `charKbn` varchar(1) DEFAULT NULL,
+  `mapChipNo` smallint(5) unsigned DEFAULT NULL,
+  `power` smallint(5) unsigned DEFAULT NULL,
+  `mobility` smallint(5) unsigned DEFAULT NULL,
+  `exclusionKbn` tinyint(4) DEFAULT NULL,
+  `lastUpdateDate` datetime DEFAULT NULL,
+  PRIMARY KEY (`battleID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_battle`
+--
+
+LOCK TABLES `t_battle` WRITE;
+/*!40000 ALTER TABLE `t_battle` DISABLE KEYS */;
+INSERT INTO `t_battle` VALUES (945153,3,'10','許楮',1,'s',86,900,500,0,'2010-10-08 04:31:01'),(7501122,2,'19','張郃',1,'b',2610,800,700,0,'2010-11-03 15:00:02'),(10608984,5,'43','孫権',2,'s',182,700,700,0,'2010-10-12 02:37:01'),(13222551,1,'7','賈詡',1,'b',2700,100,300,0,'2010-10-26 06:59:01'),(14637581,1,'15','楽進',1,'s',2700,700,600,0,'2010-10-26 06:59:01'),(15575980,1,'20','于禁',1,'b',0,700,700,0,'2010-10-26 06:59:01'),(19692992,2,'37','劉封',3,'b',136,600,500,0,'2010-11-03 15:00:02'),(39307961,3,'59','朱治',2,'b',2516,700,600,0,'2010-10-08 04:31:01'),(41467218,3,'7','賈詡',1,'b',185,100,300,0,'2010-10-08 04:31:01'),(42378115,4,'59','朱治',2,'b',2564,700,600,0,'2010-10-12 02:40:02'),(43230937,3,'51','太史慈',2,'b',2518,900,600,0,'2010-10-08 04:31:01'),(44916361,4,'49','虞翻',2,'s',2561,200,300,0,'2010-10-12 02:40:02'),(46146849,5,'62','董襲',2,'b',46,600,500,0,'2010-10-12 02:37:01'),(49580858,2,'21','龐徳',1,'s',2565,900,900,0,'2010-11-03 15
 :00:02'),(56601943,2,'33','馬岱',3,'b',222,800,900,0,'2010-11-03 15:00:02'),(62013701,4,'53','黄蓋',2,'b',2652,600,600,0,'2010-10-12 02:40:02'),(72906091,5,'53','黄蓋',2,'b',2658,600,600,0,'2010-10-12 02:37:01'),(73978570,3,'62','董襲',2,'s',2608,600,500,0,'2010-10-08 04:31:01'),(75526361,1,'61','陳武',2,'b',139,600,600,0,'2010-10-26 06:59:01'),(76119411,4,'32','魏延',3,'b',50,800,500,0,'2010-10-12 02:40:02'),(76975254,5,'29','馬超',3,'b',2564,1000,900,0,'2010-10-12 02:37:01'),(80799074,1,'50','程普',2,'b',47,700,500,0,'2010-10-26 06:59:01'),(81219871,2,'41','麋芳',3,'s',2477,500,600,0,'2010-11-03 15:00:02'),(85238533,4,'40','厳顔',3,'b',182,600,500,0,'2010-10-12 02:40:02'),(89918517,5,'31','趙雲',3,'s',2565,900,800,0,'2010-10-12 02:37:01'),(90374217,2,'5','荀攸',1,'b',2561,100,300,0,'2010-11-03 15:00:02'),(92561503,5,'36','孟達',3,'b',2518,600,600,0,'2010-10-12 02:37:01'),(93312956,3,'18','徐晃',1,'b',135,800,600,0,'2010-10-08 04:31:01'),(9344364
 3,1,'43','孫権',2,'s',2477,700,700,0,'2010-10-26 06:59:01'),(99724597,4,'22','劉備',3,'s',95,600,900,0,'2010-10-12 02:40:02');
+/*!40000 ALTER TABLE `t_battle` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_battleTemp`
+--
+
+DROP TABLE IF EXISTS `t_battleTemp`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_battleTemp` (
+  `userID` varchar(10) NOT NULL,
+  `roomID` smallint(5) unsigned DEFAULT NULL,
+  `moveMapChipNo` smallint(5) unsigned DEFAULT NULL,
+  `power` smallint(5) unsigned DEFAULT NULL,
+  PRIMARY KEY (`userID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_battleTemp`
+--
+
+LOCK TABLES `t_battleTemp` WRITE;
+/*!40000 ALTER TABLE `t_battleTemp` DISABLE KEYS */;
+/*!40000 ALTER TABLE `t_battleTemp` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_country`
+--
+
+DROP TABLE IF EXISTS `t_country`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_country` (
+  `countryID` smallint(6) NOT NULL DEFAULT '0',
+  `countryName` varchar(40) DEFAULT NULL,
+  `lastUpdateDate` datetime DEFAULT NULL,
+  PRIMARY KEY (`countryID`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_country`
+--
+
+LOCK TABLES `t_country` WRITE;
+/*!40000 ALTER TABLE `t_country` DISABLE KEYS */;
+INSERT INTO `t_country` VALUES (1,'魏','2010-04-20 01:42:09'),(2,'呉','2010-04-20 01:42:09'),(3,'蜀','2010-04-20 01:42:09');
+/*!40000 ALTER TABLE `t_country` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_defaultParam`
+--
+
+DROP TABLE IF EXISTS `t_defaultParam`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_defaultParam` (
+  `paramID` smallint(5) unsigned NOT NULL,
+  `paramType` tinyint(3) unsigned DEFAULT NULL,
+  `paramName` varchar(40) DEFAULT NULL,
+  `power` smallint(5) unsigned DEFAULT NULL,
+  `mobility` smallint(5) unsigned DEFAULT NULL,
+  `lastUpdateDate` datetime DEFAULT NULL,
+  PRIMARY KEY (`paramID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_defaultParam`
+--
+
+LOCK TABLES `t_defaultParam` WRITE;
+/*!40000 ALTER TABLE `t_defaultParam` DISABLE KEYS */;
+INSERT INTO `t_defaultParam` VALUES (101,0,'AI武将用',800,700,'2010-05-02 01:59:48'),(102,0,'AI武将用',700,600,'2010-05-02 01:59:48'),(103,0,'AI武将用',100,300,'2010-05-02 01:59:48'),(104,0,'AI武将用',100,300,'2010-05-02 01:59:48'),(105,0,'AI武将用',100,300,'2010-05-02 01:59:48'),(106,0,'AI武将用',100,300,'2010-05-02 01:59:48'),(107,0,'AI武将用',100,300,'2010-05-02 01:59:48'),(108,0,'AI武将用',300,800,'2010-05-02 01:59:48'),(109,0,'AI武将用',200,300,'2010-05-02 01:59:48'),(110,0,'AI武将用',900,500,'2010-05-02 01:59:48'),(111,0,'AI武将用',800,700,'2010-05-02 01:59:48'),(112,0,'AI武将用',800,1000,'2010-05-02 01:59:48'),(113,0,'AI武将用',700,800,'2010-05-02 01:59:48'),(114,0,'AI武将用',600,500,'2010-05-02 01:59:48'),(115,0,'AI武将用',700,600,'2010-05-02 01:59:48'),(116,0,'AI武将用',700,600,'2010-05-02 01:59:48'),(117,0,'AI武将用',800,700,'2010-05-02 01:59:48'),(118,0,'AI武将用',800,600,'2010-05-02 01:59:48'),(119,0,'AI武将
 用',800,700,'2010-05-02 01:59:48'),(120,0,'AI武将用',700,700,'2010-05-02 01:59:48'),(121,0,'AI武将用',900,900,'2010-05-02 01:59:48'),(122,0,'AI武将用',600,900,'2010-05-02 01:59:48'),(123,0,'AI武将用',300,300,'2010-05-02 01:59:48'),(124,0,'AI武将用',300,300,'2010-05-02 01:59:48'),(125,0,'AI武将用',100,300,'2010-05-02 01:59:48'),(126,0,'AI武将用',100,300,'2010-05-02 01:59:48'),(127,0,'AI武将用',900,1000,'2010-05-02 01:59:48'),(128,0,'AI武将用',1000,400,'2010-05-02 01:59:48'),(129,0,'AI武将用',1000,900,'2010-05-02 01:59:48'),(130,0,'AI武将用',900,600,'2010-05-02 01:59:48'),(131,0,'AI武将用',900,800,'2010-05-02 01:59:48'),(132,0,'AI武将用',800,500,'2010-05-02 01:59:48'),(133,0,'AI武将用',800,900,'2010-05-02 01:59:48'),(134,0,'AI武将用',800,900,'2010-05-02 01:59:48'),(135,0,'AI武将用',700,500,'2010-05-02 01:59:48'),(136,0,'AI武将用',600,600,'2010-05-02 01:59:48'),(137,0,'AI武将用',600,500,'2010-05-02 01:59:48'),(138,0,'AIæ­¦å
 °†ç”¨',600,700,'2010-05-02 01:59:48'),(139,0,'AI武将用',700,800,'2010-05-02 01:59:48'),(140,0,'AI武将用',600,500,'2010-05-02 01:59:48'),(141,0,'AI武将用',500,600,'2010-05-02 01:59:48'),(142,0,'AI武将用',800,700,'2010-05-02 01:59:48'),(143,0,'AI武将用',700,700,'2010-05-02 01:59:48'),(144,0,'AI武将用',500,800,'2010-05-02 01:59:48'),(145,0,'AI武将用',600,700,'2010-05-02 01:59:48'),(146,0,'AI武将用',300,600,'2010-05-02 01:59:48'),(147,0,'AI武将用',800,600,'2010-05-02 01:59:48'),(148,0,'AI武将用',200,700,'2010-05-02 01:59:48'),(149,0,'AI武将用',200,300,'2010-05-02 01:59:48'),(150,0,'AI武将用',700,500,'2010-05-02 01:59:48'),(151,0,'AI武将用',900,600,'2010-05-02 01:59:48'),(152,0,'AI武将用',900,700,'2010-05-02 01:59:48'),(153,0,'AI武将用',600,600,'2010-05-02 01:59:48'),(154,0,'AI武将用',800,600,'2010-05-02 01:59:48'),(155,0,'AI武将用',800,600,'2010-05-02 01:59:48'),(156,0,'AI武将用',700,600,'2010-05-02 01:59:48'),(157,0,'AIæ­¦å°
 †ç”¨',700,700,'2010-05-02 01:59:48'),(158,0,'AI武将用',700,700,'2010-05-02 01:59:48'),(159,0,'AI武将用',700,600,'2010-05-02 01:59:48'),(160,0,'AI武将用',700,600,'2010-05-02 01:59:48'),(161,0,'AI武将用',600,600,'2010-05-02 01:59:48'),(162,0,'AI武将用',600,500,'2010-05-02 01:59:48'),(163,0,'AI武将用',600,600,'2010-05-02 01:59:48'),(164,1,'ユーザデフォルト',80,70,'2010-05-02 01:59:48');
+/*!40000 ALTER TABLE `t_defaultParam` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_login`
+--
+
+DROP TABLE IF EXISTS `t_login`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_login` (
+  `userID` varchar(10) NOT NULL,
+  `sessionID` varchar(40) NOT NULL,
+  `lastLoginDate` datetime DEFAULT NULL,
+  `lastUpdateDate` datetime DEFAULT NULL,
+  PRIMARY KEY (`userID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_login`
+--
+
+LOCK TABLES `t_login` WRITE;
+/*!40000 ALTER TABLE `t_login` DISABLE KEYS */;
+INSERT INTO `t_login` VALUES ('0af5f8de42','4df09d417bde93d97216e94bdf9cb961','2010-05-05 20:51:25','2010-05-05 20:51:25'),('37ac5d6b0d','bed77a77b83fb7cf3c75e0f5c4e4f52e','2010-05-05 20:45:12','2010-05-05 20:45:12'),('3aef5d0e7e','1b7c583445661e50b86d3452f394fd12','2010-05-05 20:57:42','2010-05-05 20:57:42'),('3f84dc5de6','9b3b74f5415e669695c6cca1c36b30a2','2010-05-05 22:06:57','2010-05-05 22:06:57'),('928b4b3e82','18fec080f8af2018daab74bd5f04e845','2010-05-05 20:43:34','2010-05-05 20:43:34'),('948c0971bf','6f0000180568405017dea2b3608cd718','2010-05-05 20:45:54','2010-05-05 20:45:54'),('9e057cf47e','626f9f6ea21a2302b59922eaaf0cec24','2010-05-05 20:55:03','2010-05-05 20:55:03'),('b266f8f283','b959fa2fafeff4848052093679a8c5ae','2010-05-05 21:34:25','2010-05-05 21:34:25'),('U0143b5eaa','8cd8e9807805a77f6ff9619d6af38d3a','2010-05-12 01:39:10','2010-05-12 01:39:10'),('U02536abdc','b656eeae8055953eed8da583ec20af87','2010-05-12 03:38:06','2010-05-12 03:38:06'),('U0260be6f9','c580e
 a56f6aec5a88bd019deb1adc4b1','2010-06-22 01:37:22','2010-06-22 01:37:22'),('U02de1eda6','1d18cb5c6d9ece5bbcdc06d00b2ace62','2010-06-02 23:19:23','2010-06-02 23:19:23'),('U035514ce8','c7e5cbb32d79f059ff6fa173c79090eb','2010-05-08 19:40:02','2010-05-08 19:40:02'),('U0510488ed','dc5a04f9945f57aae193bfa638475ba8','2010-05-10 18:55:45','2010-05-10 18:55:45'),('U07d2e9cd2','e33c41cbc1e7476a1293c55bd687d7ff','2010-09-22 23:35:50','2010-09-22 23:35:50'),('U07fb00210','423a2cdbe6466cb7448ebc6461ec8ae5','2010-05-12 09:05:22','2010-05-12 09:05:22'),('U0b8206c6e','f1a8cea60f199c37e05d4c4077549332','2010-10-05 23:54:58','2010-10-05 23:54:58'),('U0db742293','263c82492cd04b56bd7b18d581773f97','2010-05-10 09:54:44','2010-05-10 09:54:44'),('U0ffa91522','b2c1d6f284e1ea2b0d76690d9e3b19d7','2010-09-10 23:57:16','2010-09-10 23:57:16'),('U102a015a9','eb82472533b5a08226ca8da428bea5cc','2010-06-24 23:41:27','2010-06-24 23:41:27'),('U10728c8da','795e5b147bbed2fa567f87c530be9f52','2010-10-01 21:37:42
 ','2010-10-01 21:37:42'),('U108c2da78','7dd55fd1a5f60548dfc58f2330a51d6f','2010-06-22 01:48:04','2010-06-22 01:48:04'),('U12d7cb916','db20d55236a46e2cd738fd5b823d77f9','2010-09-22 23:34:35','2010-09-22 23:34:35'),('U137417190','14451d859b2bfa9279555d4477b640cd','2010-10-01 01:55:32','2010-10-01 01:55:32'),('U1927eccd1','3fd0d6cdadb77abe5b749d6de4d6bcd9','2010-05-10 22:34:38','2010-05-10 22:34:38'),('U23ce4fe74','ca27fc1e98441caf86e895cec63cf9ff','2010-07-01 23:43:59','2010-07-01 23:43:59'),('U265f6d781','142d8acf19047a457d214f367de580ff','2010-05-13 23:19:02','2010-05-13 23:19:02'),('U2a666421e','6784946c1ff755d9358d08a74402bc26','2010-10-08 12:41:40','2010-10-08 12:41:40'),('U2b0f32a9d','361e6dd49e8a83aa81a1816ed0ce28e8','2010-05-08 19:35:24','2010-05-08 19:35:24'),('U2d6e34d0c','d0c4fa18f8e4981c38da01773a951820','2010-09-22 23:34:50','2010-09-22 23:34:50'),('U308f7a20e','98d9673d8924649bcce57f8ec8e768ce','2010-05-08 19:30:40','2010-05-08 19:30:40'),('U31519e2a3','42727c569
 96760bee7738dbfd410926c','2010-05-25 22:51:19','2010-05-25 22:51:19'),('U3274f4fc3','8b16b9b0a926fc1807fd7561d5ab3252','2010-07-01 23:12:32','2010-07-01 23:12:32'),('U32e997c8e','95f3d585837f3edd3a4402f9a3aa9a20','2010-05-22 23:54:04','2010-05-22 23:54:04'),('U3745c6424','67d5333c413deeb7a01d0937777b0b3b','2010-05-12 03:01:22','2010-05-12 03:01:22'),('U385674d53','454f2c0dadcc1890d8077be580c2845b','2010-08-04 01:01:40','2010-08-04 01:01:40'),('U391f182a6','425b90fb65ee8f33e8992671dfedc9ef','2010-10-05 23:46:09','2010-10-05 23:46:09'),('U39865d82b','adde2ee9b8396a5d8d6cc1f094943d4a','2010-09-18 14:16:34','2010-09-18 14:16:34'),('U3cdc73c40','23597d67d4c48742cd7954030cea3014','2010-08-23 03:24:50','2010-08-23 03:24:50'),('U3cff1c5c0','d3d0cfbc2e6adbd23f3fbb5dcafbf606','2010-10-01 02:42:46','2010-10-01 02:42:46'),('U3db03759c','78994c482aeae767d66b2c3898e6d9a7','2010-05-09 20:35:16','2010-05-09 20:35:16'),('U3e87d7517','71fcb4997e71ef648e7debd4bd65cd47','2010-10-05 23:54:18','2
 010-10-05 23:54:18'),('U43e29b1fc','305385bb43845d5e0cc4fde940e1ca9c','2010-09-20 11:46:54','2010-09-20 11:46:54'),('U444cd49d8','cc6fb959f1b5018aeefb7ebbb9984630','2010-05-12 07:21:47','2010-05-12 07:21:47'),('U45715a0de','60e34be2a35cd2a0f2e597b5163f728a','2010-10-01 02:02:22','2010-10-01 02:02:22'),('U45dbe6341','03702562dd62682a3a3d6a2de2506bd6','2010-05-09 17:54:17','2010-05-09 17:54:17'),('U463715273','04ab8e3c0671aa2c9b29e055bab8da39','2010-05-08 19:35:05','2010-05-08 19:35:05'),('U47c48c4bd','e4061c4fc9e4a07f3567b04c66d69eef','2010-05-09 19:59:07','2010-05-09 19:59:07'),('U48234910c','30c0a392d6ce2db03711ac3f86b046ee','2010-05-12 01:55:54','2010-05-12 01:55:54'),('U497afc648','ae75a2513d99acf88e40bab2642454c6','2010-05-08 19:30:18','2010-05-08 19:30:18'),('U4ab09c426','8dbe9db9085425803993bc211a48edaf','2010-10-01 21:37:29','2010-10-01 21:37:29'),('U4cdd94df9','9cbeeb470575330159dcef0c32e95e63','2010-10-03 01:05:42','2010-10-03 01:05:42'),('U4f9ae98af','c90f1e4bdcdc5
 af17efd862168fd9521','2010-10-12 13:08:14','2010-10-12 13:08:14'),('U530a26801','4004fd4abc55b225e57741989b392ed0','2010-07-24 13:10:02','2010-07-24 13:10:02'),('U539963c3e','61ab0778e67580810a1faffacb04281a','2010-05-31 00:27:50','2010-05-31 00:27:50'),('U53d045021','06b6ab20db3ad7acf25e300db39b85d3','2010-06-09 23:12:26','2010-06-09 23:12:26'),('U56bb40fc6','ab5a8ac96e06c9b964efb89cb7b25522','2010-06-23 00:33:47','2010-06-23 00:33:47'),('U5a3c17694','376e3d1ea4f2a40c969cd5136e0b6709','2010-05-26 00:12:20','2010-05-26 00:12:20'),('U5cacd0959','1fcdc1558fba9e522f976fc839704da8','2010-10-11 17:46:01','2010-10-11 17:46:01'),('U5ccbbe61d','b16b0474f425d48cb4284e31c3ad6fd2','2010-10-23 21:13:48','2010-10-23 21:13:48'),('U5fcd4871c','4af1a85c656553f82432dd216d9a4b11','2010-06-24 21:20:11','2010-06-24 21:20:11'),('U618fde241','b9ca041a908ec9ea99edadcb9204ef3a','2010-05-08 19:36:03','2010-05-08 19:36:03'),('U62906be75','45fbdb4f3d8eac6c7449330832d9bb5f','2010-10-05 08:01:25','2010-
 10-05 08:01:25'),('U636fca053','888cc6a6ba69b2ee44dcc2cd94fc06d8','2010-05-12 01:52:15','2010-05-12 01:52:15'),('U658793ef1','327f26ce49af6d5e341b8e822bb5ef81','2010-05-13 00:40:05','2010-05-13 00:40:05'),('U680fc5e0f','fa563b032856099d1c6f103333cfd72c','2010-05-08 19:37:01','2010-05-08 19:37:01'),('U6ca50b927','aa5096b6ea0b2bd1aab3d4798c44c4fe','2010-05-09 19:51:22','2010-05-09 19:51:22'),('U6cc9d3661','83955a3317e6a8a72165d0726889804b','2010-10-06 23:27:39','2010-10-06 23:27:39'),('U6cf3b4be9','edd3d2d9acbfe47188edb60f65268b8c','2010-05-12 00:30:26','2010-05-12 00:30:26'),('U6d321c457','852adbedaf473fa7b6f01965f0fe10ba','2010-09-18 14:03:04','2010-09-18 14:03:04'),('U6d8f5355d','d5812fd57c2cd7856d3bccd06ec2b6ba','2010-05-12 10:44:28','2010-05-12 10:44:28'),('U6f046622b','831a003706153d9a54301344ef3f78c4','2010-07-24 23:22:10','2010-07-24 23:22:10'),('U6f187eaa2','87b76df19533c0f4f977f33533658850','2010-09-12 01:01:36','2010-09-12 01:01:36'),('U6f2044637','bd8630e2d5542926e
 c4b785519ab2224','2010-05-12 08:56:35','2010-05-12 08:56:35'),('U702c142e7','50e607d307ec30d6b6e3047a05c3936a','2010-05-09 20:29:52','2010-05-09 20:29:52'),('U707fad461','7829f1c55f1c1653666a07b00f89d93e','2010-05-12 01:48:12','2010-05-12 01:48:12'),('U71d945382','e24c5c5919ba85e83554336563c70f0d','2010-05-10 22:13:05','2010-05-10 22:13:05'),('U7236438f9','a83a311070a58065a801f117b1747c76','2010-10-01 21:37:22','2010-10-01 21:37:22'),('U760295e46','4a21365f57f682b2d0021764ac951243','2010-05-13 01:19:25','2010-05-13 01:19:25'),('U77d5aef64','ede20c87369e2a08f7c8bc745cf9f1f4','2010-05-12 02:23:44','2010-05-12 02:23:44'),('U7ae8dfb79','79bb636f81b07b3b262639672a212a05','2010-05-12 01:14:42','2010-05-12 01:14:42'),('U7b87ae651','bab613a8c97c921e72e85f94e1dd3e36','2010-10-07 23:40:59','2010-10-07 23:40:59'),('U7d608dcd4','81b985ac254ceecdaaac1ff4f5e04a53','2010-05-10 10:07:50','2010-05-10 10:07:50'),('U7ee62fc81','f4f08b4c12cbc197dcd00062950d63f4','2010-05-12 02:26:20','2010-05-1
 2 02:26:20'),('U80a762653','7c1a4b82cdd62504f672fd1e084d21da','2010-10-05 23:51:49','2010-10-05 23:51:49'),('U82c0d8bb1','c6072d7f2ea788ccd381458f990a537f','2010-09-23 15:54:19','2010-09-23 15:54:19'),('U82df0fc43','9f1701acadcecf47458f8ec59e5b4ccf','2010-05-13 21:58:22','2010-05-13 21:58:22'),('U832ad15df','f0a338292ca6191d7f1bf77c4dc0ed0b','2010-09-28 05:02:12','2010-09-28 05:02:12'),('U835961fff','1ada0f5e37784dd9e55fbfbc49e088c2','2010-05-09 20:18:06','2010-05-09 20:18:06'),('U83ab85c1b','44883dc3ff76a5f4661ba14127c7e94d','2010-05-08 19:57:33','2010-05-08 19:57:33'),('U855e8f47f','cc911ac2a2bc60e9cf3d7244019cbb37','2010-05-20 23:12:50','2010-05-20 23:12:50'),('U86299a24d','b1801a7075791eda4292a3caa74d8197','2010-09-22 23:33:24','2010-09-22 23:33:24'),('U8a85cbf01','e4d9e03c34c4f076c4cad3815fb3aceb','2010-10-21 06:53:02','2010-10-21 06:53:02'),('U8a8ab895d','bb477fd6d669c2e463739cc01d4baa0a','2010-05-12 02:32:43','2010-05-12 02:32:43'),('U8d59d045c','1a52be5734ca2c765af54
 280e3cb6ad4','2010-10-01 01:53:50','2010-10-01 01:53:50'),('U8db42a714','aafffc7acd732b98608bf4d6525b6616','2010-05-08 19:30:45','2010-05-08 19:30:45'),('U909311f65','3155bb3bd8002319536d47c7e4221d08','2010-11-03 10:39:08','2010-11-03 10:39:08'),('U91357ac04','6f446a24ee2a68caf59e8fae4bfd7f26','2010-10-02 13:56:19','2010-10-02 13:56:19'),('U92dd41180','4483f035e129f27363547ed8ee006b26','2010-07-24 22:46:39','2010-07-24 22:46:39'),('U93328fdc4','63c15d1d5bf03a1348962f495e447743','2010-05-09 17:42:31','2010-05-09 17:42:31'),('U94998bf97','16b7f832a5ad8ec372998529542f9027','2010-09-20 18:53:34','2010-09-20 18:53:34'),('U9b306706c','b3e99360995cc9faad0eef2effd56008','2010-06-05 11:22:06','2010-06-05 11:22:06'),('U9b7b4d7ad','9834b8c4e051f05b9725a3f705ea3f82','2010-05-12 04:02:13','2010-05-12 04:02:13'),('U9b96081c1','43559ca0f91eb325442b2155999a0730','2010-07-31 22:42:05','2010-07-31 22:42:05'),('U9be5c652d','6c433d91adca094de3138cbab1ebae35','2010-05-08 17:04:05','2010-05-08 17
 :04:05'),('U9c5119c02','b3059eeeaf1f9ed1a2b4ca3a7c82300c','2010-10-01 02:01:27','2010-10-01 02:01:27'),('U9d2026cfe','dd77f01570c1f3bc79cbd07f988e9d4b','2010-07-02 02:32:18','2010-07-02 02:32:18'),('Ua0fe52ce6','7e0246a25b0ed9d83d027d28f135f885','2010-05-12 01:41:46','2010-05-12 01:41:46'),('Ua17b802ea','0f70239d98944807ec20182fdf8d4904','2010-10-11 22:15:23','2010-10-11 22:15:23'),('Ua2d33ecf7','775d7ddaefe5c2cbfe52865af1a0e653','2010-05-10 09:53:39','2010-05-10 09:53:39'),('Ua663f0756','c693fb841b2fb89c110cadd5984e20b9','2010-05-12 06:47:25','2010-05-12 06:47:25'),('Uab8e34897','6452eb6d063e278c272e39b4428eb8b6','2010-05-10 21:37:38','2010-05-10 21:37:38'),('Uac487712c','4655bc00488eef5d32f8149b682f9328','2010-09-21 17:20:44','2010-09-21 17:20:44'),('Uaef8d99b1','23fc9a6707161ef690aeed7fe784762b','2010-08-14 15:21:10','2010-08-14 15:21:10'),('Ub0c4cfd3c','31db526f5ed70d7a50cce2b8de2e7536','2010-06-02 17:46:22','2010-06-02 17:46:22'),('Ub4199fa12','c1fcb0f02ffcb1606ec9f3944
 4eb237f','2010-10-08 12:41:08','2010-10-08 12:41:08'),('Ub5752cc53','86bb47453a2d0ca9821d8e26d39f1884','2010-05-13 05:37:12','2010-05-13 05:37:12'),('Ub5c58b6be','5b5779bd40ccd83a3434b1236be2d479','2010-06-26 04:26:21','2010-06-26 04:26:21'),('Ub9a310e2a','aa28e556819c9cb91aaa8044fc7f7b06','2010-10-01 01:56:26','2010-10-01 01:56:26'),('Ubadbf7558','9df9ed41e8a68c2ea37a4ebd7b6eea4c','2010-05-12 02:23:29','2010-05-12 02:23:29'),('Ubb447ca40','279ab97b2fb42dc3c745ce46a7d30077','2010-09-18 14:03:59','2010-09-18 14:03:59'),('Ubbd31de5c','a59c3d04856c9df138c06d2c05490ca3','2010-05-08 19:43:48','2010-05-08 19:43:48'),('Uc12d9b351','bc8827efa951e067fbaa680e528c3a6d','2010-07-02 01:50:35','2010-07-02 01:50:35'),('Uc18025643','60bf8ca957363b7fcbd14a206e9ccfe8','2010-05-09 17:46:34','2010-05-09 17:46:34'),('Uc50e52674','82032eab1a5301a57a0790dca7c828c5','2010-05-08 19:37:15','2010-05-08 19:37:15'),('Uca72602cb','4115c2bc2c6f066fee510635cdd75cfb','2010-09-18 17:31:53','2010-09-18 17:31:
 53'),('Uccccbde0a','2ec50514ff2296520761e3e68e9fd81f','2010-09-21 17:37:30','2010-09-21 17:37:30'),('Ucd924588a','180dfffc61d5bd1da891b9ae66f64244','2010-05-31 08:20:44','2010-05-31 08:20:44'),('Ucfae42d5b','41e8038aed347868d8cf273aba7ac4ef','2010-07-11 16:16:24','2010-07-11 16:16:24'),('Ud026db27d','c3732ee4a0cb883ab258268e081d9719','2010-06-02 07:30:04','2010-06-02 07:30:04'),('Ud32632b05','c1d1bb47081284cb55f94f30da0cfde8','2010-07-01 23:07:20','2010-07-01 23:07:20'),('Ud474bcd73','0fdcfbd07a893ffec59ff2c2790b7a7f','2010-05-10 06:37:02','2010-05-10 06:37:02'),('Ud686002bf','c9d2c5861bb324a8a25854971bc0ee15','2010-09-18 14:13:48','2010-09-18 14:13:48'),('Ud7ad8712e','c35615e736a54f3fb268ab740e880bd7','2010-07-03 01:00:41','2010-07-03 01:00:41'),('Ud80eac800','fa98ae8bdbb3670d27d9420567701ca1','2010-07-01 23:06:44','2010-07-01 23:06:44'),('Ude5101aea','5fe646e7054d3c0629f1cc9e9274e556','2010-05-12 03:06:45','2010-05-12 03:06:45'),('Udf0c7365d','eb2a37a4adf42c68a301473d1241b
 12e','2010-10-01 21:37:57','2010-10-01 21:37:57'),('Ue0c7bba79','224b41bf03a468685538283684e627b3','2010-09-22 23:33:50','2010-09-22 23:33:50'),('Ue30d2e3da','880d2947aa1a2e7a263ab5d99751e81f','2010-05-13 20:18:16','2010-05-13 20:18:16'),('Ue46a98fbb','18488da5ab1c69aa577dade5fe94a6a6','2010-05-10 09:58:29','2010-05-10 09:58:29'),('Ue728341a1','989d496f775de9153d7fe2d06c18be50','2010-10-23 21:13:33','2010-10-23 21:13:33'),('Ue73ed1c70','f7a7aace601d2a5fa7ab3013363b0dac','2010-05-13 00:38:16','2010-05-13 00:38:16'),('Ue8a15b047','a56e3bdef2fed0b6cb56058df836a259','2010-05-09 20:05:05','2010-05-09 20:05:05'),('Uea36db2f7','2c2a795a15be6f90264f9e2443824106','2010-10-12 13:08:33','2010-10-12 13:08:33'),('Ued7c6b37f','76f92b02f70a6ac0b948571dcd57383c','2010-05-08 20:34:06','2010-05-08 20:34:06'),('Uee2327278','cac7b4be6bcc815aa3bb4ad2d275a3cc','2010-05-10 23:08:25','2010-05-10 23:08:25'),('Uef2ec541a','20232508e7f5b037e55029c2565d3fef','2010-06-02 00:10:38','2010-06-02 00:10:38')
 ,('Uf09cf742a','80fa5e93c69ca442f3f5190214f585b4','2010-10-11 22:16:04','2010-10-11 22:16:04'),('Uf1cee9840','eea802699a5a81cd537c6898282f3753','2010-05-12 02:18:12','2010-05-12 02:18:12'),('Uf23e58a24','94a10d050fa0e4737aff9a60ca0f87c0','2010-05-12 01:45:05','2010-05-12 01:45:05'),('Uf4b0e06e2','c2fe0f859a44c834485aca7bbe616b8d','2010-07-24 13:09:39','2010-07-24 13:09:39'),('Uf4d1187c6','41489cf0d193754c17260c9956263998','2010-05-12 02:11:29','2010-05-12 02:11:29'),('Uf7b146095','e5e5890ff911b5fe06df12b74deae3bf','2010-05-12 06:35:59','2010-05-12 06:35:59'),('Uf85c12875','888e76c7dc45e49803e1ac2bf96ef5c9','2010-09-14 12:48:52','2010-09-14 12:48:52'),('Uf97f64209','4975c817f291dd11beba47b5a5a9405a','2010-09-18 14:00:41','2010-09-18 14:00:41'),('Ufbc370dc6','cdd1878b0dc17d62158debc2878df005','2010-05-20 23:07:50','2010-05-20 23:07:50'),('Ufc48316c6','736a0ef470d530819aac1bbafad6fefc','2010-10-08 13:44:13','2010-10-08 13:44:13'),('Ufcde30624','ef10d4e00ccb368f4de15fbe82a531e7'
 ,'2010-06-29 22:42:12','2010-06-29 22:42:12'),('Ufd75e5be5','9c44b8073419bdef8332bc3e5f042667','2010-10-07 12:54:37','2010-10-07 12:54:37');
+/*!40000 ALTER TABLE `t_login` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_map`
+--
+
+DROP TABLE IF EXISTS `t_map`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_map` (
+  `mapID` smallint(5) unsigned NOT NULL,
+  `mapName` varchar(40) DEFAULT NULL,
+  `mapExplanation` varchar(100) DEFAULT NULL,
+  `mapComponent` varchar(1000) DEFAULT NULL,
+  `lastUpdateDate` varchar(45) DEFAULT NULL,
+  PRIMARY KEY (`mapID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_map`
+--
+
+LOCK TABLES `t_map` WRITE;
+/*!40000 ALTER TABLE `t_map` DISABLE KEYS */;
+INSERT INTO `t_map` VALUES (1,'夷陵戦','','1111111111111111111111111111111111114441111111111111161111111111111111111111111111111111111111114441111111111111166111111111111111111111111111111111111111114441111111111111111111111111111111111111111111111111111111114441111111111111111111111111111111111111111111111111111111114441111111111111111111111111111111111111111111111111111111114441111111111111111111111111111111111111111111111111111111114441111111111111111111111111111111111111111111111111111111144411111111111111111111111111111111111111111111111111111111144411111111111111111111111111111111111111111411111111111111144411111111111111111111111111111111111111114411111111111111144411111111111111111111111111111111111111114111111111111111144411111111111111111111111111111111111111144111111111111111144411111111111111111111111111111111111111144111111111111111444111111111111111111111111111111111111111144111111111111111444111111111111111111111111111111111111111141111111111111111444111111
 111111111111111111111111111111111441111111111111114441111','2010-05-02 02:01:38'),(2,'合肥戦','','333333666333333333338883333333338333333333332333333333333333333333666333333333333388833333338333333333332333333333333333333333366333333333333333888333338333333333332333333333333333333333366333333333333333338883338333333333322333333333333333333333333333333333333333333388838333333333322333333333333333333333333333333333333333333333888333333333322333333333333333633333333333333333333333333333338833333333322333333333333333633333333333333333333333333333333833333333322333333333333333333333322233333333322233333333333833333333322333333333333333333333222222333333222233333333333833333333322333333333333333333333322222333333222333333333333833333333222333333333333388333333333323333373333333333333333833333333222333333888888883333333333333333333333333333333333833333332888888888833333333333333333333333333333333333333333833333338823333333333333333333333333333333333333333333333333833333888223333
 3333333333333332222333333333333333333333333338333338322333333333333333333332223333333333333333333333333338888888','2010-05-02 02:01:38'),(3,'陽平関戦','','11111111331111111111111111111111111111111111111111111113311111111111311111111111111111111111111111111111111111111111311111111111311111111111111111111111111111111111111111111111331111111113311111111111111111111111111111111111111111111111133111111113111111111111111111111111111111111111111111111111113111111113111111111111111111111111111111111111111111111111113311111113111111111111111111111111111111111111111111111111111311111113111111111111111111111111111111111111111111111111111311111111111111111111111111111111111111111111111311111111111311111111111111111111131111111111111111111111111311111111111311111111111111111111131111111111111111111111113311111111111311111111111111111111131111111111111111111111113111111111111311111111111111111111331111111111111111111111113222222222222311111111111111111111311111111111111111122222233222
 22222222231111111111111111111131112222211111111222222233222222222222231111111222222222111132222222222221122222222332222222222222231111112222222222255232222222222222222222','2010-05-02 02:01:38');
+/*!40000 ALTER TABLE `t_map` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_room`
+--
+
+DROP TABLE IF EXISTS `t_room`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_room` (
+  `roomID` smallint(5) unsigned NOT NULL,
+  `roomName` varchar(40) DEFAULT NULL,
+  `roomStatus` tinyint(3) unsigned DEFAULT NULL,
+  `offenseCountry` smallint(5) unsigned DEFAULT NULL,
+  `defenseCountry` smallint(5) unsigned DEFAULT NULL,
+  `mapID` smallint(5) unsigned DEFAULT NULL,
+  `maxTurnCount` smallint(5) unsigned DEFAULT NULL,
+  `turnCount` smallint(5) unsigned DEFAULT NULL,
+  `lastUpdateDate` datetime DEFAULT NULL,
+  PRIMARY KEY (`roomID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_room`
+--
+
+LOCK TABLES `t_room` WRITE;
+/*!40000 ALTER TABLE `t_room` DISABLE KEYS */;
+INSERT INTO `t_room` VALUES (1,'夷陵',2,1,2,1,60,0,'2010-10-26 06:59:01'),(2,'夷陵',2,1,3,1,60,0,'2010-11-03 15:00:01'),(3,'合肥',2,2,1,2,60,0,'2010-10-08 04:31:01'),(4,'合肥',2,2,3,2,60,0,'2010-10-12 02:40:02'),(5,'陽平関',2,3,2,3,60,0,'2010-10-12 02:37:01');
+/*!40000 ALTER TABLE `t_room` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_turnTimer`
+--
+
+DROP TABLE IF EXISTS `t_turnTimer`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_turnTimer` (
+  `roomID` smallint(5) unsigned DEFAULT NULL,
+  `receiptTime` datetime DEFAULT NULL,
+  `turnInterval` int(11) DEFAULT NULL,
+  `gameInterval` int(11) DEFAULT NULL,
+  `timerStatus` smallint(5) unsigned DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_turnTimer`
+--
+
+LOCK TABLES `t_turnTimer` WRITE;
+/*!40000 ALTER TABLE `t_turnTimer` DISABLE KEYS */;
+INSERT INTO `t_turnTimer` VALUES (1,'2010-10-26 06:59:01',180,300,0),(2,'2010-11-03 15:00:02',180,300,0),(3,'2010-10-08 04:31:01',180,300,0),(4,'2010-10-12 02:40:02',180,300,0),(5,'2010-10-12 02:37:01',180,300,0);
+/*!40000 ALTER TABLE `t_turnTimer` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_user`
+--
+
+DROP TABLE IF EXISTS `t_user`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_user` (
+  `userID` varchar(10) NOT NULL,
+  `twitterID` varchar(40) DEFAULT NULL,
+  `userName` varchar(40) DEFAULT NULL,
+  `twitterToken` varchar(40) DEFAULT NULL,
+  `country` smallint(5) unsigned DEFAULT NULL,
+  `paramID` smallint(5) unsigned DEFAULT NULL,
+  `lastUpdateDate` datetime DEFAULT NULL,
+  PRIMARY KEY (`userID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_user`
+--
+
+LOCK TABLES `t_user` WRITE;
+/*!40000 ALTER TABLE `t_user` DISABLE KEYS */;
+INSERT INTO `t_user` VALUES ('0af5f8de42',NULL,'',NULL,NULL,NULL,'2010-05-05 20:51:25'),('37ac5d6b0d',NULL,'abcdefg',NULL,NULL,NULL,'2010-05-05 20:45:12'),('3aef5d0e7e',NULL,'あいうえお',NULL,NULL,NULL,'2010-05-05 20:57:42'),('3f84dc5de6',NULL,'zxxxx',NULL,NULL,NULL,'2010-05-05 22:06:57'),('41967a8ac5',NULL,'d',NULL,NULL,NULL,'2010-05-02 22:09:44'),('4a02f8fff3',NULL,'e',NULL,NULL,NULL,'2010-05-02 22:23:36'),('83bfee2209',NULL,'',NULL,NULL,NULL,'2010-05-02 22:24:06'),('928b4b3e82',NULL,'',NULL,NULL,NULL,'2010-05-05 20:43:34'),('948c0971bf',NULL,'\\\'',NULL,NULL,NULL,'2010-05-05 20:45:54'),('9e057cf47e',NULL,'',NULL,NULL,NULL,'2010-05-05 20:55:03'),('b266f8f283',NULL,'ccccccc',NULL,NULL,NULL,'2010-05-05 21:20:23'),('da73eceb9d',NULL,'b',NULL,NULL,NULL,'2010-05-02 21:52:15'),('dd215e93af',NULL,'a',NULL,NULL,NULL,'2010-05-02 22:44:59'),('e20ceab73e',NULL,'c',NULL,NULL,NULL,'2010-05-02 21:54:45'),('U0143b5eaa',NULL,'Uee2327278',NULL,1,164,'2010-05-12 01:39:10'),('U02536abdc
 ',NULL,'ak3_test3',NULL,2,164,'2010-05-12 03:38:05'),('U0260be6f9',NULL,'tttttt',NULL,1,164,'2010-06-22 01:37:18'),('U02de1eda6',NULL,'うほほのほ',NULL,2,164,'2010-06-02 23:19:17'),('U035514ce8',NULL,'000009',NULL,1,164,'2010-05-08 19:40:02'),('U0510488ed',NULL,'test007',NULL,3,164,'2010-05-10 09:24:40'),('U07d2e9cd2',NULL,'凛',NULL,2,164,'2010-09-22 23:35:22'),('U07fb00210',NULL,'ist 101',NULL,3,164,'2010-05-12 09:05:15'),('U0b8206c6e',NULL,'hononohoh',NULL,2,164,'2010-10-05 23:54:55'),('U0db742293',NULL,'test009',NULL,1,164,'2010-05-10 09:54:44'),('U0ffa91522',NULL,'shinrai',NULL,3,164,'2010-09-10 23:57:11'),('U102a015a9',NULL,'Demo player 2',NULL,3,164,'2010-06-24 23:41:24'),('U10728c8da',NULL,'ak_12345678',NULL,1,164,'2010-10-01 21:37:40'),('U108c2da78',NULL,'AA',NULL,2,164,'2010-06-22 01:48:01'),('U12d7cb916',NULL,'咲',NULL,3,164,'2010-09-22 23:34:35'),('U137417190',NULL,'rossi_',NULL,2,164,'2010-10-01 01:55:28'),('U1927eccd1',NULL,'test',NULL,2,164,'2010-05-10 2
 2:34:27'),('U23ce4fe74',NULL,'rossi3',NULL,2,164,'2010-07-01 23:43:57'),('U265f6d781',NULL,'ma_6',NULL,3,164,'2010-05-13 23:19:00'),('U28cfcc1b9',NULL,'てんき',NULL,1,164,'2010-05-11 23:07:14'),('U2a666421e',NULL,'タカ',NULL,3,164,'2010-10-08 12:41:35'),('U2b0f32a9d',NULL,'000005',NULL,2,164,'2010-05-08 19:35:24'),('U2d6e34d0c',NULL,'ぬぅ',NULL,2,164,'2010-09-22 23:34:50'),('U308f7a20e',NULL,'000002',NULL,3,164,'2010-05-08 19:30:40'),('U31519e2a3',NULL,'ひろゆ',NULL,1,164,'2010-05-25 22:51:11'),('U3274f4fc3',NULL,'rossi2',NULL,2,164,'2010-07-01 23:12:25'),('U32e997c8e',NULL,'ma_11',NULL,1,164,'2010-05-22 23:54:02'),('U3745c6424',NULL,'ak3_test',NULL,1,164,'2010-05-12 03:01:22'),('U385674d53',NULL,'IS01',NULL,2,164,'2010-08-04 01:01:40'),('U391f182a6',NULL,'narunaru235',NULL,1,164,'2010-10-05 23:46:02'),('U39865d82b',NULL,'りゅう',NULL,1,164,'2010-09-18 14:16:28'),('U39f2b20aa',NULL,'aaa',NULL,3,164,'2010-05-11 01:32:30'),('U3cdc73c40',NULL,'ak-test',NULL,3,164,'
 2010-08-23 03:24:48'),('U3cff1c5c0',NULL,'narunaru512234',NULL,3,164,'2010-10-01 02:42:41'),('U3db03759c',NULL,'test005',NULL,2,164,'2010-05-09 20:35:16'),('U3e87d7517',NULL,'teltelte122',NULL,3,164,'2010-10-05 23:54:14'),('U43e29b1fc',NULL,'hikki',NULL,2,164,'2010-09-20 11:46:53'),('U444cd49d8',NULL,'ma_1',NULL,1,164,'2010-05-12 07:21:41'),('U45715a0de',NULL,'narunaru51223!',NULL,2,164,'2010-10-01 02:02:22'),('U45dbe6341',NULL,'xxx0003',NULL,1,164,'2010-05-09 17:49:48'),('U463715273',NULL,'000004',NULL,1,164,'2010-05-08 19:35:05'),('U47c48c4bd',NULL,'test002',NULL,1,164,'2010-05-09 19:59:07'),('U497afc648',NULL,'000001',NULL,1,164,'2010-05-08 19:30:18'),('U4ab09c426',NULL,'ak_12345',NULL,3,164,'2010-10-01 21:37:29'),('U4cdd94df9',NULL,'茶図',NULL,2,164,'2010-10-03 01:05:30'),('U4f9ae98af',NULL,'うぬり',NULL,2,164,'2010-10-12 13:08:14'),('U530a26801',NULL,'yyy',NULL,3,164,'2010-07-24 13:09:59'),('U539963c3e',NULL,'moo_twit',NULL,3,164,'2010-05-31 00:27:50'),('U53d045021
 ',NULL,'tenki',NULL,3,164,'2010-06-09 23:12:05'),('U56bb40fc6',NULL,'nnn',NULL,3,164,'2010-06-23 00:33:45'),('U5a3c17694',NULL,'ゆきひろろろ',NULL,2,164,'2010-05-26 00:12:13'),('U5cacd0959',NULL,'たなか',NULL,2,164,'2010-10-11 17:45:54'),('U5ccbbe61d',NULL,'あか',NULL,1,164,'2010-10-23 21:13:42'),('U5fcd4871c',NULL,'Demo player',NULL,1,164,'2010-06-24 21:20:07'),('U618fde241',NULL,'000006',NULL,3,164,'2010-05-08 19:36:03'),('U62906be75',NULL,'toyo',NULL,1,164,'2010-10-05 08:00:40'),('U658793ef1',NULL,'ma_3',NULL,2,164,'2010-05-13 00:40:03'),('U680fc5e0f',NULL,'000007',NULL,2,164,'2010-05-08 19:37:01'),('U6ca50b927',NULL,'test001',NULL,3,164,'2010-05-09 19:51:22'),('U6cc9d3661',NULL,'testooooooo',NULL,3,164,'2010-10-06 23:27:36'),('U6cf3b4be9',NULL,'aaaa',NULL,2,164,'2010-05-12 00:30:26'),('U6d321c457',NULL,'よりと',NULL,1,164,'2010-09-18 14:02:41'),('U6d8f5355d',NULL,'ak3_test1',NULL,1,164,'2010-05-12 10:44:26'),('U6f046622b',NULL,'裕之でーす',NULL,3,164,'
 2010-07-24 23:22:02'),('U6f187eaa2',NULL,'テスト',NULL,1,164,'2010-09-12 01:01:31'),('U6f2044637',NULL,'ist_001',NULL,3,164,'2010-05-12 08:56:24'),('U702c142e7',NULL,'test004',NULL,1,164,'2010-05-09 20:29:51'),('U707fad461',NULL,'test013',NULL,3,164,'2010-05-12 01:48:12'),('U71d945382',NULL,'たっき',NULL,3,164,'2010-05-10 22:12:50'),('U7236438f9',NULL,'ak_1234567890',NULL,3,164,'2010-10-01 21:37:12'),('U760295e46',NULL,'ma_5',NULL,1,164,'2010-05-13 01:19:23'),('U7ae8dfb79',NULL,'qqq',NULL,2,164,'2010-05-12 01:14:42'),('U7b87ae651',NULL,'momomoo',NULL,3,164,'2010-10-07 23:40:55'),('U7bd5r6a2d',NULL,'taka8',NULL,1,164,'2010-05-09 15:08:09'),('U7d608dcd4',NULL,'test011',NULL,2,164,'2010-05-10 10:07:50'),('U7ebaf5c0b',NULL,'aaat',NULL,2,164,'2010-05-11 01:32:48'),('U80a762653',NULL,'narunaru2345',NULL,3,164,'2010-10-05 23:51:46'),('U82c0d8bb1',NULL,'regoris ',NULL,3,164,'2010-09-23 15:54:13'),('U82df0fc43',NULL,'あかさたな',NULL,1,164,'2010-05-13 21:58:10'),('U832ad15
 df',NULL,'ぐんぐん',NULL,2,164,'2010-09-28 05:02:00'),('U835961fff',NULL,'test003',NULL,2,164,'2010-05-09 20:18:06'),('U83ab85c1b',NULL,'000012',NULL,3,164,'2010-05-08 19:57:33'),('U855e8f47f',NULL,'shige',NULL,3,164,'2010-05-20 23:12:49'),('U86299a24d',NULL,'策',NULL,1,164,'2010-09-22 23:33:20'),('U8a85cbf01',NULL,'TK',NULL,1,164,'2010-10-21 06:53:02'),('U8d59d045c',NULL,'narunaru23',NULL,2,164,'2010-10-01 01:53:50'),('U8db42a714',NULL,'000003',NULL,1,164,'2010-05-08 19:30:45'),('U909311f65',NULL,'WA',NULL,3,164,'2010-11-03 10:39:02'),('U91357ac04',NULL,'たなはまやら',NULL,3,164,'2010-10-02 13:56:16'),('U92dd41180',NULL,'nihongoutenai',NULL,2,164,'2010-07-24 22:46:36'),('U93328fdc4',NULL,'xxx0001',NULL,2,164,'2010-05-09 17:42:31'),('U94998bf97',NULL,'はろきち',NULL,3,164,'2010-09-20 18:52:05'),('U9b306706c',NULL,'hohoho',NULL,1,164,'2010-06-05 11:22:03'),('U9b7b4d7ad',NULL,' ak3_tests',NULL,2,164,'2010-05-12 04:02:11'),('U9b96081c1',NULL,'もも',NULL,1,164,'
 2010-07-31 22:42:01'),('U9be5c652d',NULL,'aaaaaaaaaa',NULL,NULL,1,'2010-05-08 17:04:05'),('U9c5119c02',NULL,'あかさたなはまやらわ',NULL,3,164,'2010-10-01 02:01:25'),('U9d2026cfe',NULL,'Anknown',NULL,1,164,'2010-07-02 02:31:12'),('Ua0fe52ce6',NULL,'Ue',NULL,2,164,'2010-05-12 01:41:46'),('Ua17b802ea',NULL,'アボカド',NULL,2,164,'2010-10-11 22:15:23'),('Ua2d33ecf7',NULL,'test008',NULL,3,164,'2010-05-10 09:53:39'),('Ua663f0756',NULL,'裕之',NULL,1,164,'2010-05-12 06:47:25'),('Uab8e34897',NULL,'non',NULL,3,164,'2010-05-10 21:37:32'),('Uac487712c',NULL,'tyamaz ',NULL,1,164,'2010-09-21 17:20:44'),('Uaef8d99b1',NULL,'おおららら',NULL,1,164,'2010-08-14 15:21:08'),('Ub0c4cfd3c',NULL,'ペア\n',NULL,3,164,'2010-06-02 17:46:18'),('Ub4199fa12',NULL,'Taka',NULL,2,164,'2010-10-08 12:41:08'),('Ub5752cc53',NULL,'test_102',NULL,3,164,'2010-05-13 05:37:09'),('Ub5c58b6be',NULL,'taro',NULL,2,164,'2010-06-26 04:26:04'),('Ub9a310e2a',NULL,'narunaru51223',NULL,1,164,'2010-10-01 0
 1:55:57'),('Ubadbf7558',NULL,'Uee23454323',NULL,2,164,'2010-05-12 02:23:29'),('Ubb447ca40',NULL,'oritoy',NULL,3,164,'2010-09-18 14:03:40'),('Ubbd31de5c',NULL,'000011',NULL,3,164,'2010-05-08 19:43:48'),('Uc12d9b351',NULL,'testes',NULL,3,164,'2010-07-02 01:49:32'),('Uc18025643',NULL,'xxx0002',NULL,1,164,'2010-05-09 17:46:34'),('Uc50e52674',NULL,'000008',NULL,3,164,'2010-05-08 19:37:15'),('Uca72602cb',NULL,'政志っす',NULL,2,164,'2010-09-18 17:31:53'),('Uccccbde0a',NULL,'かんすけ',NULL,1,164,'2010-09-21 17:37:30'),('Ucd924588a',NULL,'okotaneko',NULL,3,164,'2010-05-31 08:20:44'),('Ucfae42d5b',NULL,'へろゆき',NULL,1,164,'2010-07-11 16:16:19'),('Ud026db27d',NULL,'futatan ',NULL,1,164,'2010-06-02 07:29:59'),('Ud32632b05',NULL,'rossijp',NULL,1,164,'2010-07-01 23:07:15'),('Ud474bcd73',NULL,'test006',NULL,1,164,'2010-05-10 06:37:02'),('Ud686002bf',NULL,'白起',NULL,3,164,'2010-09-18 14:10:11'),('Ud7ad8712e',NULL,'ankown1',NULL,1,164,'2010-07-03 01:00:39'),('Ud80eac800',NUL
 L,'rossi',NULL,3,164,'2010-07-01 23:06:44'),('Ude5101aea',NULL,'ak3_test2',NULL,1,164,'2010-05-12 03:06:19'),('Udf0c7365d',NULL,'ak_123',NULL,2,164,'2010-10-01 21:37:56'),('Ue0c7bba79',NULL,'佐久',NULL,1,164,'2010-09-22 23:33:50'),('Ue30d2e3da',NULL,'ひろゆき',NULL,3,164,'2010-05-13 20:18:12'),('Ue46a98fbb',NULL,'test010',NULL,1,164,'2010-05-10 09:58:29'),('Ue728341a1',NULL,'あ',NULL,2,164,'2010-10-23 21:13:33'),('Ue73ed1c70',NULL,'ma_2',NULL,2,164,'2010-05-13 00:38:14'),('Ue8a15b047',NULL,'xxx0004',NULL,3,164,'2010-05-09 20:03:15'),('Uea36db2f7',NULL,'うぬり\n',NULL,3,164,'2010-10-12 13:08:19'),('Ued7c6b37f',NULL,'000010',NULL,2,164,'2010-05-08 19:40:28'),('Uee2327278',NULL,'akifumi3_test',NULL,3,164,'2010-05-10 23:08:17'),('Uef2ec541a',NULL,'ひるゆき',NULL,3,164,'2010-06-02 00:10:32'),('Uf09cf742a',NULL,'アボカド\n',NULL,3,164,'2010-10-11 22:15:07'),('Uf1cee9840',NULL,'123345678900',NULL,1,164,'2010-05-12 02:18:12'),('Uf23e58a24',NULL,'ttttt',NULL,2,164,'
 2010-05-12 01:45:05'),('Uf4b0e06e2',NULL,'uuii\n',NULL,3,164,'2010-07-24 13:09:39'),('Uf7b146095',NULL,'hiroyuki',NULL,2,164,'2010-05-12 06:35:59'),('Uf85c12875',NULL,'moon',NULL,2,164,'2010-09-14 12:48:34'),('Uf97f64209',NULL,'ktsugita',NULL,3,164,'2010-09-18 14:00:17'),('Ufbc370dc6',NULL,'shige0501',NULL,3,164,'2010-05-20 23:07:50'),('Ufbcf6bfcc',NULL,'test 012',NULL,1,164,'2010-05-11 01:40:54'),('Ufc48316c6',NULL,'hoge',NULL,2,164,'2010-10-08 13:44:06'),('Ufcde30624',NULL,'ankown',NULL,1,164,'2010-06-29 22:27:30'),('Ufd75e5be5',NULL,'よーこ。',NULL,2,164,'2010-10-07 12:54:14');
+/*!40000 ALTER TABLE `t_user` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_userAction`
+--
+
+DROP TABLE IF EXISTS `t_userAction`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_userAction` (
+  `userID` varchar(10) NOT NULL,
+  `roomID` smallint(5) unsigned DEFAULT NULL,
+  `moveMapChipNo` smallint(5) unsigned DEFAULT NULL,
+  `battleCommandID` smallint(5) unsigned DEFAULT NULL,
+  `battleMapChipNo` smallint(5) unsigned DEFAULT NULL,
+  `lastUpdateDate` datetime DEFAULT NULL,
+  PRIMARY KEY (`userID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_userAction`
+--
+
+LOCK TABLES `t_userAction` WRITE;
+/*!40000 ALTER TABLE `t_userAction` DISABLE KEYS */;
+/*!40000 ALTER TABLE `t_userAction` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `t_userStatus`
+--
+
+DROP TABLE IF EXISTS `t_userStatus`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t_userStatus` (
+  `userID` varchar(10) NOT NULL,
+  `win` int(10) unsigned DEFAULT NULL,
+  `lost` int(10) unsigned DEFAULT NULL,
+  `lastUpdateDate` datetime DEFAULT NULL,
+  PRIMARY KEY (`userID`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `t_userStatus`
+--
+
+LOCK TABLES `t_userStatus` WRITE;
+/*!40000 ALTER TABLE `t_userStatus` DISABLE KEYS */;
+INSERT INTO `t_userStatus` VALUES ('U0260be6f9',0,0,'2010-06-22 01:37:19'),('U02de1eda6',0,0,'2010-06-02 23:19:17'),('U07d2e9cd2',0,0,'2010-09-22 23:35:22'),('U0b8206c6e',0,0,'2010-10-05 23:54:55'),('U0ffa91522',0,0,'2010-09-10 23:57:11'),('U102a015a9',0,0,'2010-06-24 23:41:24'),('U10728c8da',0,0,'2010-10-01 21:37:40'),('U108c2da78',0,0,'2010-06-22 01:48:01'),('U12d7cb916',0,0,'2010-09-22 23:34:35'),('U137417190',0,0,'2010-10-01 01:55:28'),('U23ce4fe74',0,0,'2010-07-01 23:43:57'),('U2a666421e',0,0,'2010-10-08 12:41:35'),('U2d6e34d0c',0,0,'2010-09-22 23:34:50'),('U31519e2a3',0,0,'2010-05-25 22:51:11'),('U3274f4fc3',0,0,'2010-07-01 23:12:25'),('U32e997c8e',0,0,'2010-05-22 23:54:02'),('U385674d53',0,0,'2010-08-04 01:01:40'),('U391f182a6',0,0,'2010-10-05 23:46:02'),('U39865d82b',0,0,'2010-09-18 14:16:28'),('U3cdc73c40',0,0,'2010-08-23 03:24:48'),('U3cff1c5c0',0,0,'2010-10-01 02:42:41'),('U3e87d7517',0,0,'2010-10-05 23:54:14'),('U43e29b1fc',0,0,'2010-09-20 11:46:54'),('U45715a0de
 ',0,0,'2010-10-01 02:02:22'),('U4ab09c426',0,0,'2010-10-01 21:37:29'),('U4cdd94df9',0,0,'2010-10-03 01:05:30'),('U4f9ae98af',0,0,'2010-10-12 13:08:14'),('U530a26801',0,0,'2010-07-24 13:09:59'),('U539963c3e',0,0,'2010-05-31 00:27:50'),('U53d045021',0,0,'2010-06-09 23:12:05'),('U56bb40fc6',0,0,'2010-06-23 00:33:45'),('U5a3c17694',0,0,'2010-05-26 00:12:13'),('U5cacd0959',0,0,'2010-10-11 17:45:54'),('U5ccbbe61d',0,0,'2010-10-23 21:13:42'),('U5fcd4871c',0,0,'2010-06-24 21:20:07'),('U62906be75',0,0,'2010-10-05 08:00:40'),('U6cc9d3661',0,0,'2010-10-06 23:27:36'),('U6d321c457',0,0,'2010-09-18 14:02:41'),('U6f046622b',0,0,'2010-07-24 23:22:03'),('U6f187eaa2',0,0,'2010-09-12 01:01:31'),('U7236438f9',0,0,'2010-10-01 21:37:12'),('U7b87ae651',0,0,'2010-10-07 23:40:55'),('U80a762653',0,0,'2010-10-05 23:51:46'),('U82c0d8bb1',0,0,'2010-09-23 15:54:13'),('U832ad15df',0,0,'2010-09-28 05:02:00'),('U855e8f47f',0,0,'2010-05-20 23:12:49'),('U86299a24d',0,0,'2010-09-22 23:33:20'),('U8a85cbf01',0,0
 ,'2010-10-21 06:53:02'),('U8d59d045c',0,0,'2010-10-01 01:53:50'),('U909311f65',0,0,'2010-11-03 10:39:02'),('U91357ac04',0,0,'2010-10-02 13:56:16'),('U92dd41180',0,0,'2010-07-24 22:46:36'),('U94998bf97',0,0,'2010-09-20 18:52:05'),('U9b306706c',0,0,'2010-06-05 11:22:03'),('U9b96081c1',0,0,'2010-07-31 22:42:01'),('U9c5119c02',0,0,'2010-10-01 02:01:25'),('U9d2026cfe',0,0,'2010-07-02 02:31:12'),('Ua17b802ea',0,0,'2010-10-11 22:15:23'),('Uac487712c',0,0,'2010-09-21 17:20:44'),('Uaef8d99b1',0,0,'2010-08-14 15:21:08'),('Ub0c4cfd3c',0,0,'2010-06-02 17:46:18'),('Ub4199fa12',0,0,'2010-10-08 12:41:08'),('Ub5c58b6be',0,0,'2010-06-26 04:26:04'),('Ub9a310e2a',0,0,'2010-10-01 01:55:57'),('Ubb447ca40',0,0,'2010-09-18 14:03:40'),('Uc12d9b351',0,0,'2010-07-02 01:49:32'),('Uca72602cb',0,0,'2010-09-18 17:31:53'),('Uccccbde0a',0,0,'2010-09-21 17:37:30'),('Ucd924588a',0,0,'2010-05-31 08:20:44'),('Ucfae42d5b',0,0,'2010-07-11 16:16:19'),('Ud026db27d',0,0,'2010-06-02 07:29:59'),('Ud32632b05',0,0,'201
 0-07-01 23:07:15'),('Ud686002bf',0,0,'2010-09-18 14:10:11'),('Ud7ad8712e',0,0,'2010-07-03 01:00:39'),('Ud80eac800',0,0,'2010-07-01 23:06:44'),('Udf0c7365d',0,0,'2010-10-01 21:37:56'),('Ue0c7bba79',0,0,'2010-09-22 23:33:50'),('Ue728341a1',0,0,'2010-10-23 21:13:33'),('Uea36db2f7',0,0,'2010-10-12 13:08:19'),('Uef2ec541a',0,0,'2010-06-02 00:10:32'),('Uf09cf742a',0,0,'2010-10-11 22:15:07'),('Uf4b0e06e2',0,0,'2010-07-24 13:09:39'),('Uf85c12875',0,0,'2010-09-14 12:48:35'),('Uf97f64209',0,0,'2010-09-18 14:00:17'),('Ufbc370dc6',0,0,'2010-05-20 23:07:50'),('Ufc48316c6',0,0,'2010-10-08 13:44:06'),('Ufcde30624',0,0,'2010-06-29 22:27:30'),('Ufd75e5be5',0,0,'2010-10-07 12:54:14');
+/*!40000 ALTER TABLE `t_userStatus` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2010-11-06  0:02:41

Added: tags/Ver.0.1.5/server/grantSQL.txt
===================================================================
--- tags/Ver.0.1.5/server/grantSQL.txt	                        (rev 0)
+++ tags/Ver.0.1.5/server/grantSQL.txt	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,4 @@
+
+GRANT SELECT,INSERT,UPDATE,DELETE ON o_sangokushi.* TO phpuser @ localhost IDENTIFIED BY 'password';
+set password for phpuser @ localhost=password('sangokushiphpuser');
+

Added: tags/Ver.0.1.5/server/server_php/AI.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/AI.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/AI.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,156 @@
+<?php
+
+	require('dbutil.php');	
+	
+	define('DEFENCE_AREA', 600);
+	define('MAP_MAX', 3600);
+	define('MAP_UP', -60);
+	define('MAP_DOWN', 60);
+	define('MAP_LEFT', -1);
+	define('MAP_RIGHT', +1);
+	define('MAP_LEFTUP', -61);
+	define('MAP_RIGHTUP', -59);
+	define('MAP_LEFTDOWN', 59);
+	define('MAP_RIGHTDOWN', 61);
+	
+	function aiAction($roomid){
+	
+		$db = new DBConnection();
+		$session = new DBSession($db);
+		$db->AssignDBConnection($session);
+		
+		// 処理対象AI取得
+		$sql = 'select userID, countryID, mapChipNo, charKbn from t_battle where roomID=:roomID and charKbn<>:charKbn and exclusionKbn=0';
+		$param = array(":roomID" => "$roomid", ":charKbn" => 'U');
+		
+		$result = $session->query_select($sql, $param);
+		
+		// 総大将位置取得
+		$sql = 'select countryID, mapChipNo from t_battle where roomID=:roomID and charKbn:=charKbn';
+		$param = array(":roomID" => "$roomID", ":charKbn" => "S");
+		$king = $session->query_select($sql, $param);
+				
+		foreach($result as $row) {
+		
+			$userID = $result[0];
+			$countryID = $result[1];
+			$mapChipNo = $result[2];
+			$charKgn = $result[3];
+			
+			// 近くに敵がいた場合、攻撃
+			$sql = 'select mapChipNo from t_battle where roomID=:roomID and countryID<>:countryID and mapChipNo in (:map1, :map2, map3, map4, map5, map6, map7, map8) order by power';
+			$param = array(":roomID" => "$roomID", ":countryID" => "$countryID",
+						":map1" => $mapChipNo + MAP_LEFTUP, ":map2" => $mapChipNo + MAP_UP, ":map3" => $mapChipNo + MAP_RIGHTUP,
+						 ":map4" => $mapChipNo + MAP_LEFT, ":map5" => $mapChipNo + MAP_RIGHT, ":map6" => $mapChipNo + MAP_LEFTDOWN,
+						 ":map7" => $mapChipNo + MAP_DOWN, ":map8" => $mapChipNo + MAP_RIGHTDOWN);
+		
+			$result = $session->query_select($sql, $param);
+		
+			if (!empty($result)){
+					
+				$battleCommandID = 1;
+						
+				$sql_insert_uaction = 'insert into t_userAction (userID, roomID, battleCommandID, battleMapChipNo, lastUpdateDate) values (:userID, :roomID, :battleCommandID, :battleMapChipNo, now())';
+				$param_insert_uaction = array(":userID" => "$userID", ":roomID" => "$roomid", ":battleCommandID" => "$battleCommandID", ":battleMapChipNo" => " $result[0][0]");
+						
+				$result_insert_uaction = $session->query_update($sql_insert_uaction, $param_insert_uaction);
+					
+			} elseif ($charKgn == 'B') {
+				// 武将のみの行動 とりあえず、IDが奇数が攻撃型、偶数が守備型に
+				if(($useID % 2) == 1){
+					// 攻撃型
+					// 敵国の総大将のマップチップNo取得
+					if($king[0][0] <> $countryID){
+					
+						$targetmapchipno = $king[0][1];
+						
+					} else {
+					
+						$targetmapchipno = $king[1][1];
+					
+					}
+				} else {
+				
+					// 守備型
+					// 自国の総大将のマップチップNo取得
+					if($king[0][0] == $countryID){
+					
+						$kingmapchipno = $king[0][1];
+					
+					} else {
+					
+						$kingmapchipno = $king[1][1];
+					
+					}
+					
+					// 自国の防衛範囲の最深部にいる敵マップチップを取得
+					if($kingmapchipno < (MAP_MAX / 2)){
+					
+						$defencearea = DEFENCE_AREA;
+						$sql_search_enemy = 'select mapChipNo from t_battle where roomID=:roomID and countryID<>:countryID and mapChipNo < :mapChipNo order by mapChipNo';
+					
+					} else {
+
+						$defencearea = MAP_MAX - DEFENCE_AREA;
+						$sql_search_enemy = 'select mapChipNo from t_battle where roomID=:roomID and countryID<>:countryID and mapChipNo > :mapChipNo order by mapChipNo desc';
+					
+					}
+					
+					$param_search_enemy = array(":userID" => "$userID", ":roomID" => "$roomID", ":countryID" => "$countryID", ":mapChipNo" => "$defencearea");
+					$result_search_enemy = $session->query_select($sql_search_enemy, $param_search_enemy);
+					
+					if (!empty($result_search_enemy)){
+					
+						$targetmapchipno = $result_search_enemy[0][0];
+					
+					} else {
+					
+						$targetmapchipno = '';
+					
+					}
+				
+				}
+				
+				// 移動先マップチップ設定
+				if (!empty($targetmapchipno)) {
+					// マップ縦位置比較
+					$mapChipRow = floor($mapChipNo / 60);
+					$targetmapchiprow = floor($targetmapchipno / 60);
+					
+					if ($mapChipRow < $targetmapchiprow) {
+					
+						$moveMapChipNo = $mapChipRow + MAP_UP;
+					
+					} elseif ($mapChipRow > $targetmapchiprow){
+					
+						$moveMapChipNo = $mapChipRow + MAP_DOWN;
+					
+					} else {
+					
+						// マップ横位置比較
+						if($mapChipNo < $targetmapchipno) {
+						
+							$moveMapChipNo = $mapChipNo + MAP_RIGHT;
+							
+						} elseif ($mapChipNo > $targetmapchipno) {
+						
+							$moveMapChipNo = $mapChipNo + MAP_LEFT;
+						
+						}
+					}
+				} else {
+				
+					$moveMapChipNo = $mapChipNo;
+				
+				}
+				
+				$sql_insert_uaction = 'insert into t_userAction (userID, roomID, moveMapChipNo, lastUpdateDate) values (:userID, :roomID, :moveMapChipNo, now())';
+				$param_insert_uaction = array(":userID" => "$userID", ":roomID" => "$roomid", ":moveMapChipNo" => "$moveMapChipNo");
+						
+				$result_insert_uaction = $session->query_update($sql_insert_uaction, $param_insert_uaction);
+				
+			}
+		
+		}
+	
+	}

Added: tags/Ver.0.1.5/server/server_php/battleCalc.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/battleCalc.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/battleCalc.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,45 @@
+<?php
+
+	function battlecalculate() {
+
+		try {
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select userID, roomID, moveMapChipNo, battleCommandID, battleMapChipNo from t_userAction';
+			$result = $session->query_select($sql, $pa);
+
+			if (empty($result)) {
+				throw new Exception('0080002', SYSTEM_ERROR);
+			} else {
+				foreach($result as $row) {
+					if (! empty($row['battleMapChipNo'])) {
+						$sql = 'update t_battle set power = power - :dp where battleMapChipNo = :bMapchip and roomID = :rid';
+						$pa = array( ":dp" => DEC_POWER, ":bMapchip" => $row['battleMapChipNo'], ":roomID" => $row['rid']);
+						$result_uid = $session->query_select($sql, $pa);
+					}
+				}
+
+				foreach($result as $row) {
+					if (! empty($row['moveMapChipNo'])) {
+						$sql = 'update t_battle set mapChipNo = :mapChipNo where userID = :uid and roomID = :rid';
+						$pa = array( ":mapChipNo" => $row['moveMapChipNo'], ":userID" => $row['userID'], ":roomID" => $row['rid']);
+						$result_uid = $session->query_select($sql, $pa);
+					}
+				}
+			}
+
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			if ($e->getCode() == SYSTEM_ERROR) {
+				throw $e;
+			} else {
+				throw new Exception('00002', SYSTEM_ERROR);
+			}
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/checkLib.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/checkLib.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/checkLib.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,55 @@
+<?php
+
+	function userIDCheck($uid) {
+
+
+		if (strlen($uid) <> USERID_CNT) {
+			throw new Exception('00100', SYSTEM_ERROR);
+		}
+
+		if (substr($uid, 0, 1) <> USERID_PREFIX) {
+			throw new Exception('00101', SYSTEM_ERROR);
+		}
+		
+		return $uid;
+
+	}
+
+	function roomIDCheck($rid) {
+
+		if (! is_numeric($rid)) {
+			throw new Exception('00200', SYSTEM_ERROR);
+		}
+
+		return $rid;
+
+	}
+	
+	function sessionCheck($cmd, $uid, $sid) {
+		
+		require('sessionException.php');
+
+		switch($cmd) {
+		
+			case 'xxxxx':
+				$db = new DBConnection();
+				$session = new DBSession($db);
+				$db->AssignDBConnection($session);
+	
+				$uid = userIDCheck($uid);
+		
+				$sql = 'select userID from t_login where userID = :userID and sessionID = :sessionID';
+				$param = array(":userID" => "$uid",
+						":sessionID" => "$sid");
+		
+				$result = $session->query_select($sql, $param);
+		
+				if (empty($result)) {
+		
+					throw new sessionException('セッション違い', SESSION_ERROR);
+		
+				}
+		}
+	
+	}
+

Added: tags/Ver.0.1.5/server/server_php/dbparam.inc
===================================================================
--- tags/Ver.0.1.5/server/server_php/dbparam.inc	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/dbparam.inc	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,68 @@
+<?php
+/**
+ * データベースアクセスに関するパッケージです
+ *
+ * データベースへ接続するパラメータの記述です。
+ * 
+ * @category   Database
+ * @package    dbutil
+ * @author     okotaneko
+ * @version    1.0
+ * @access     public
+ */
+
+/**
+ * ここは inlcude DocBlock です。
+ *
+ * inlcude ファイルの説明など書きます。
+ */
+
+/**
+ * データベースの種類
+ *
+ * @var string 接続データベース種類
+ */
+define('DB_CON_TYPE', 'mysql');
+
+/**
+ * デフォルトデータベースの接続先
+ * 
+ * @var string 接続データベース接続先
+ */
+define('DB_CON_HOST', '127.0.0.1');
+
+/**
+ * デフォルトデータベース名称
+ * 
+ * @var string 接続データベース名
+ */
+define('DB_CON_NAME', 'dbname');
+
+/**
+ * デフォルトデータベースポート名
+ * 
+ * @var string 接続先ポート番号
+ */
+define('DB_CON_PORT', '0000');
+
+/**
+ * デフォルトデータベース接続ユーザ名
+ * 
+ * @var string 接続データユーザ名
+ */
+define('DB_CON_USER', 'user');
+
+/**
+ * デフォルトデータベース接続ユーザパスワード
+ * 
+ * @var string 接続データベース接続ユーザパスワード
+ */
+define('DB_CON_PASS', 'useroass');
+
+/**
+ * 文字コードセット
+ * 
+ * @var string 文字コードセット
+ */
+define('CHAR_SET', 'SET NAMES UTF-8');
+

Added: tags/Ver.0.1.5/server/server_php/dbutil.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/dbutil.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/dbutil.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,371 @@
+<?php
+/**
+ * データベースアクセスに関するパッケージです
+ *
+ * このパーッケージのデータベースへアクセスはPDOを使用します。
+ * データベースの接続文字はこのパッケージ内に記述しています。
+ * 例外が発生した時はこのクラスを呼び出し元で処理してください
+ * 
+ * @category   Database
+ * @package    dbutil
+ * @author     okotaneko
+ * @version    1.0
+ * @access     public
+ */
+
+/**
+ * inlcude DocBlock です。
+ *
+ * inlcude ファイルの説明など書きます。
+ */
+
+require('dbparam.inc');
+
+
+/**
+ * データベース接続クラス
+ *
+ * データベースへの接続と切断を管理します。
+ * データベース接続のインスタンスをデータアクセスクラスに渡します。
+ * 
+ * @category   database
+ * @package    dbutil
+ * @author     okotaneko
+ * @version    0.1
+ * @access     public
+ */
+class DBConnection {
+
+	/**
+	 * データベースインスタンス
+	 * @var object 接続時のインスタンスを保持する
+	 * @access public
+	 */
+	private $db = null;
+
+	/**
+	 * データベース接続状態の保持
+	 * 
+	 * @var Bool データベースの接続状態 接続中 = True 未接続 = False
+	 * @access public
+	 */
+	private $ConnectFlg = False;
+
+	/**
+	 * データベース接続文字列
+	 * 
+	 * @var string データベースの接続文字列
+	 * @access public
+	 */
+	private $DBparam = null;
+
+	/**
+	 * データベースユーザー名
+	 * 
+	 * @var string データベースのユーザー名
+	 * @access public
+	 */
+	private $DBUser = null;
+
+	/**
+	 * データベースユーザーパスワード
+	 * 
+	 * @var string データベースのユーザーパスワード
+	 * @access public
+	 */
+	private $DBPassWD = null;
+
+
+	/**
+	 * コンストラクタ
+	 * 
+	 * データベースの接続文字の設定は、データベースの種類($DBType)が設定されていない場合デフォルト値を使います。
+	 * 
+	 * @param string $DBType データベースの種類
+	 * @param string $Host データベース接続先ホスト名
+	 * @param string $Port データベース接続先ポート名
+	 * @param string $DBName データベース名
+	 * @param string $UserName データベースユーザ名
+	 * @param string $PassWD データベースパスワード
+	 * @return void
+	 * @access public
+	 */	
+	public function __construct($DBType = null, $Host = null, $Port = null, $DBName = null, $UserName = null, $PassWD = null) {
+
+		if (is_null($DBType)) {
+			$this->DBparam = DB_CON_TYPE . ':dbname=' . DB_CON_NAME . ';host=' . DB_CON_HOST . ' port=' . DB_CON_PORT;
+			$this->DBUser = DB_CON_USER;
+			$this->DBPassWD = DB_CON_PASS;
+		} else {
+			$this->Dbparam = $DBType . ':dbname=' . $DBName . ' host=' . $Host . ' port=' . $Port;
+			$this->DBUser = $UserName;
+			$this->DBPassWD = $PassWD;
+		}
+		
+		
+		$this->Connect();
+	}
+
+	/**
+	 * デストラクタ
+	 *
+	 * @return void
+	 * @access public
+	 */
+	public function __destruct() {
+		$db = null;
+	}
+
+	/**
+	 * データベースに接続します。。
+	 * データベース接続のインスタンスを作成します。
+	 *
+	 * @return void 
+	 * @access public
+	 */
+	public function Connect() {
+
+		if (! $this->ConnectFlg) {
+			$this->DisConnect();
+	}
+
+		$this->db = new PDO($this->DBparam, $this->DBUser, $this->DBPassWD);
+	    $this->db->query('CHAR_SET');
+		$this->ConnectFlg = True;
+	}
+	
+	/**
+	 * データベースの接続を切断します。。
+	 * データベース接続のインスタンスを解放します。
+	 *
+	 * @return void 
+	 * @access public
+	 */
+	public function DisConnect() {
+
+		$this->db = null;
+		$this->ConnectFlg = False;
+	}
+
+	/**
+	 * データベース接続状態を返す
+	 * 
+	 * @return Bool $ConnectFlg 接続中=True 未接続=False
+	 * @access public
+	 */
+	public function Connected() {
+
+		return $this->ConnectFlg;
+	}
+
+	/**
+	 * データベース接続インスタンスをセッションクラスに渡す
+	 *
+	 * @param object $DBsession セッションクラスのインスタンス
+	 * @return void 
+	 * @access public
+	 */
+	public function AssignDBConnection($DBsession){
+
+		$DBsession->SetDBConnection($this->db);
+	}
+
+	/**
+	 * クラスに存在しないプロパティへの書込みははエラーとする
+	 *
+	 * @param string $name アクセスするプロパティ名
+	 * @param string $value プロパティ値
+	 * @return void
+	 * @access public
+	 */
+	function __set($name, $value) {
+
+		throw new Exception('存在しないプロパティへのアクセス');
+	}
+
+	/**
+	 * クラスに存在しないプロパティの読込はエラーとする
+	 *
+	 * @param string $name アクセスするプロパティ名
+	 * @return oject
+	 * @access public
+	 */
+	function __get($name) {
+
+		throw new Exception('存在しないプロパティへのアクセス');
+	}
+
+	/**
+	 * クラスに存在しないメソッドの実行ははエラーとする
+	 *
+	 * @param string $name アクセスするメソッド名
+	 * @param array $arguments メソッドの引数(ハッシュ配列)
+	 * @return void
+	 * @access public
+	 */
+	function __call($name, $arguments) {
+
+		throw new Exception('存在しないメソッドへのアクセス');
+	}
+}
+
+/**
+ * データベースアクセスクラス
+ *
+ * データベースへのセッションを保持します。。
+ * データベース接続のインスタンスをコネクションクラスから取得しデータベースへアクセスします。
+ * 例外が発生した時はこのクラスを呼び出し元で処理してください
+ * 
+ * @category   databese
+ * @package    dbutil
+ * @author     okotaneko
+ * @version    0.1
+ * @access     public
+ */
+class DBSession {
+	
+	/**
+	 * データベースインスタンス
+	 * データベースインスタンスを接続クラスからもらいます。(参照)
+	 * @var object データベース接続インスタンス
+	 * @access public
+	 */	
+	private $Db = null;
+	
+	/**
+	 * コンストラクタ
+	 *
+	 * @param object $DBConnection データベース接続のインスタンス ない場合は渡さなくてもよい
+	 * @return void
+	 * @access public
+	 */
+	public function __construct($DBConnection = null) {
+		
+		if (! is_null($DBConnection)) {
+			$this->SetDBConnection($DBConnection);
+		}
+	}
+	
+	/**
+	 * デストラクタ
+	 *
+	 * @return void
+	 * @access public
+	 */
+	public function __destruct() {
+
+	}
+
+    /**
+     * データベースコネクションクラスをセットする
+     * データベース接続のインスタンスの参照をセットします。
+     *
+     * @param object $DBConnection データベース接続のインスタンス
+     * @return void 
+     * @access public
+     */
+	public function SetDBConnection($DBConnection) {
+
+		$this->Db = $DBConnection;
+	}
+
+	/**
+	 * select文を発行する
+	 *
+	 * @param array $s PDOStatementオブジェクト
+	 * @param array $param バインド変数の項目と値のハッシュ配列
+	 * @return void
+	 * @access private
+	 */
+	private function setBindParam(&$s, &$param) {
+
+		if (! empty($param)) {
+			foreach ($param as $key => $value) {
+				$s->bindParam("$key", $value);
+			}
+		}
+	}
+
+	/**
+	 * select文を発行する
+	 *
+	 * @param string $sql 実行するSQL文必ずバインド変数を使用すること
+	 * @param array $param バインド変数の項目と値のハッシュ配列
+	 * @return array string 結果セット
+	 * @return void
+	 * @access public
+	 */
+	public function query_select(&$sql, &$param) {
+
+		$s = $this->Db->prepare($sql);
+		$this->setBindParam($s, $param);
+
+		if (! $s->execute($param)) {
+			throw new Exception('0030001', SYSTEM_ERROR);
+		}
+
+		return $s->fetchAll();
+
+	}
+
+	/**
+	 * insert update delete文を発行する
+	 *
+	 * @param string $sql 実行するSQL文必ずバインド変数を使用すること
+	 * @param array $param バインド変数の項目と値のハッシュ配列
+	 * @return integer 更新した行数
+	 * @access public
+	 */
+	public function query_update(&$sql, &$param) {
+
+		$s = $this->Db->prepare($sql);
+		$this->setBindParam($s, $param);
+
+		if (! $s->execute($param)) {
+			throw new Exception('0030002', SYSTEM_ERROR);
+		}
+
+		return $s->rowCount();
+
+	}
+
+	/**
+	 * クラスに存在しないプロパティへの書込みははエラーとする
+	 *
+	 * @param string $name アクセスするプロパティ名
+	 * @param string $value プロパティ値
+	 * @return void
+	 * @access public
+	 */
+	function __set($name, $value) {
+
+		throw new Exception('存在しないプロパティへのアクセス');
+	}
+
+	/**
+	 * クラスに存在しないプロパティの読込はエラーとする
+	 *
+	 * @param string $name アクセスするプロパティ名
+	 * @return oject
+	 * @access public
+	 */
+	function __get($name) {
+
+		throw new Exception('存在しないプロパティへのアクセス');
+	}
+
+	/**
+	 * クラスに存在しないメソッドの実行ははエラーとする
+	 *
+	 * @param string $name アクセスするメソッド名
+	 * @param array $arguments メソッドの引数(ハッシュ配列)
+	 * @return void
+	 * @access public
+	 */
+	function __call($name, $arguments) {
+
+		throw new Exception('存在しないメソッドへのアクセス');
+	}
+	
+}
+

Added: tags/Ver.0.1.5/server/server_php/entryNewUser.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/entryNewUser.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/entryNewUser.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,199 @@
+<?php
+
+	function commandExecute(&$sid) {
+
+		try {
+		
+			/*
+			$username = $_GET['un'];
+			$latitude = $_GET['lat'];
+			$longitude = $_GET['lan'];
+			*/
+			
+			$username = $_POST['un'];
+			$latitude = $_POST['lat'];
+			$longitude = $_POST['lan'];
+			
+			if (strlen($username) == 0 || strlen($username) > USERNAME_CNT) {
+				// メッセージは仮
+				throw new Exception('01000', SYSTEM_ERROR);
+			}
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+			
+			// ユーザ名の重複チェック
+			$sql_name_search = 'select userName from t_user where userName = :userName';
+			$param_name_search = array(":userName" => "$username");
+			
+			$result_name_search = $session->query_select($sql_name_search, $param_name_search);
+			
+			if (!empty($result_name_search)){
+				// メッセージは仮
+				throw new Exception('02000', SYSTEM_ERROR);
+			}
+			
+			// 初期パラメータ取得
+			$sql_default_param = 'select paramID from t_defaultParam where paramType=1';
+			$result_default_param = $session->query_select($sql_default_param, $pa);
+			
+			if (empty($result_default_param)) {
+				// メッセージは仮
+				throw new Exception('07000', SYSTEM_ERROR);
+			
+			}
+			
+			$default_param = $result_default_param[0][0];
+			
+			// 人口が一番少ない国を取得
+			$sql_country_count = 'select a.country, b.countryName, count(*) from t_user a, t_country b where a.country = b.countryID group by 1 order by 3';
+			$result_country_count = $session->query_select($sql_country_count, $pa);
+			
+			if (empty($result_country_count)){
+			
+				$defaultCountry = 1;
+				
+			} else {
+			
+				$defaultCountry = $row_country_count[0][0];
+				$defaultCountryName = $row_country_count[0][1];
+			
+			}
+			
+			// 国データ取得
+			$sql_country = 'select countryID, countryName from t_country order by countryID';
+			$result_country = $session->query_select($sql_country, $pa);
+			
+			// GPS以外の場合
+			if ($latitude == 0 || $longitude == 0) {
+			
+				$num = rand(1, 9);
+				
+				if ($num <= 3) {
+				
+					$countryid = $result_country[0][0];
+					$countryname = $result_country[0][1];
+					
+				} elseif ($num <= 6) {
+				
+					$countryid = $result_country[1][0];
+					$countryname = $result_country[1][1];
+				
+				} else {
+				
+					$countryid = $result_country[2][0];
+					$countryname = $result_country[2][1];
+				
+				}
+			
+			} else {
+			
+				// GPSの場合
+				$lati_mod = $latitude % 2;
+				$longi_mod = $longitude % 2;
+				
+				if ($lati_mod == 1 && $longi_mod == 1) {
+				
+					$countryid = $result_country[0][0];
+					$countryname = $result_country[0][1];
+				
+				} elseif ($lati_mod == 0 && $longi_mod == 1) {
+				
+					$countryid = $result_country[1][0];
+					$countryname = $result_country[1][1];
+				
+				} elseif ($lati_mod == 0 && $longi_mod == 0) {
+				
+					$countryid = $result_country[2][0];
+					$countryname = $result_country[2][1];
+				
+				} else {
+				
+					$countryid = $defaultCountry;
+					$countryname = $defaultCountryName;
+				}
+			
+			}			
+			
+			// ユーザ登録
+			$sql_id_search = 'select userID from t_user where userID = :userID';
+			$sql_insert_user = 'insert into t_user (userID, userName, paramID, country, lastUpdateDate) values (:userID, :userName, :paramID, :country, now())';
+			
+			$entry_flg = false;
+						
+			for($i=0; $i<3; $i++) {
+				$userid = USERID_PREFIX . substr(md5(uniqid()),-9);
+				
+				$param_id_search = array(":userID" => "$userid");
+				
+				$result_id_search = $session->query_select($sql_id_search, $param_id_search);
+				
+				if(empty($result_id_search)) {
+				
+					$param_insert_user = array(":userID" => "$userid",
+												":userName" => "$username",
+												":paramID" => "$default_param",
+												":country" => "$countryid");
+						
+					$result_insert_uesr = $session->query_update($sql_insert_user, $param_insert_user);
+					
+					if ($result_insert_uesr != 1) {
+						// メッセージは仮
+						throw new Exception('03000', SYSTEM_ERROR);
+					}
+					
+					$entry_flg = true;
+					
+					break;
+				
+				}
+			}
+			
+			if ($entry_flg ==false) {
+				// メッセージは仮
+				throw new Exception('04000', SYSTEM_ERROR);
+			}
+			
+			$sql_insert_user = 'insert into t_userStatus values (:userID, :win, :lost, now())';
+
+			$param_insert_user = array(":userID" => "$userid", ":win" => "0", ":lost" => "0");
+			$result_insert_uesr = $session->query_update($sql_insert_user, $param_insert_user);
+
+			if ($result_insert_uesr != 1) {
+ 				// メッセージは仮
+ 				throw new Exception('03000', SYSTEM_ERROR);
+ 			}
+			
+			// ログイン情報登録
+			// セッションID?は仮
+			$sessionid = md5(uniqid(rand(),1));
+			
+			$sql_insert_login = 'insert into t_login (userID, sessionID, lastLoginDate, lastUpdateDate) values (:userID, :sessionID, now(), now())';
+			$param_insert_login = array(":userID" => "$userid",
+										":sessionID" => "$sessionid");
+			
+			$result_insert_login = $session->query_update($sql_insert_login, $param_insert_login);
+			
+			if ($result_insert_login != 1) {
+				// メッセージは仮
+				throw new Exception('05000', SYSTEM_ERROR);
+			}			
+			
+			$sid = $sessionid;
+			$data = $userid . SP. $countryid . SP . $countryname;
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			if ($e->getCode() == SYSTEM_ERROR) {
+				throw $e;
+			} else {
+				// メッセージは仮
+				throw new Exception('06000', SYSTEM_ERROR);
+			}
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/getAICharParam.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/getAICharParam.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/getAICharParam.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,27 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select a.charName, c.countryName, d.power, d.mobility from t_country c, t_defaultParam d, t_AICharacter a where a.countryID = c.countryID and a.paramID = d.paramID';
+			$result = $session->query_select($sql, $pa);
+
+			foreach($result as $row) {
+				$data = $data . $row[0] . SP . $row[1] . SP . $row[2] . SP . $row[3] . RLF;
+			}
+			$data = rtrim($data, RLF);
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			throw new Exception('00002', SYSTEM_ERROR);
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/getBattleResult.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/getBattleResult.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/getBattleResult.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,38 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$rid = roomIDCheck($_POST['roomid']);
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select timerStatus from t_turnTimer where timerStatus != 2';
+			$result = $session->query_select($sql, $pa);
+
+			if(empty($result)) {
+				$data = '@';
+			} else {
+				$sql = 'select charKbn, userName, countryID, mapChipNo, power from t_battle where :roomID = :roomID';
+				$pa = array(":roomID" => "$rid");
+
+				$result = $session->query_select($sql, $pa);
+
+				foreach($result as $row) {
+					$data = $data . $row[0] . SP . $row[1] . SP . $row[2] . SP . $row[3] . SP . $row[4] . RLF;
+				}
+				$data = rtrim($data, RLF);
+			}
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			throw new Exception('00002', SYSTEM_ERROR);
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/getIniUserParam.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/getIniUserParam.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/getIniUserParam.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,27 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select power, mobility from t_defaultParam where paramType = 1';
+			$result = $session->query_select($sql, $pa);
+
+			foreach($result as $row) {
+				$data = $data . $row[0] . SP . $row[1] . RLF;
+			}
+			$data = rtrim($data, RLF);
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			throw new Exception('00002', SYSTEM_ERROR);
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/getMapInfo.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/getMapInfo.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/getMapInfo.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,27 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select mapID, mapName, mapExplanation, mapComponent from t_map';
+			$result = $session->query_select($sql, $pa);
+
+			foreach($result as $row) {
+				$data = $data . $row[0] . SP . $row[1] . SP . $row[2] . SP . $row[3] . RLF;
+			}
+			$data = rtrim($data, RLF);
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			throw new Exception('00002', SYSTEM_ERROR);
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/getRoomInfo.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/getRoomInfo.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/getRoomInfo.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,27 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select roomID, roomName, roomStatus, offenseCountry, defenseCountry, mapID, maxTurnCount, turnCount from t_room where roomStatus in (0, 2)';
+			$result = $session->query_select($sql, $pa);
+
+			foreach($result as $row) {
+				$data = $data . $row[0] . SP . $row[1] . SP . $row[2] . SP . $row[3] . SP . $row[4] . SP . $row[5] . SP . $row[6] . SP . $row[7] . RLF ;
+			}
+			$data = rtrim($data, RLF);
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			throw new Exception('00002', SYSTEM_ERROR);
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/getRoomStatus.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/getRoomStatus.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/getRoomStatus.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,27 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select roomID, battleRoomID, turnCount from t_roomStatus;
+			$result = $session->query_select($sql, $pa);
+
+			foreach($result as $row) {
+				$data = $data . $row[0] . SP . $row[1] . SP . $row[2] . RLF;
+			}
+			$data = rtrim($data, RLF);
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			throw new Exception('00002', SYSTEM_ERROR);
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/getRoomTurnCount.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/getRoomTurnCount.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/getRoomTurnCount.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,34 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$rid = roomIDCheck($_POST['roomid']);
+			
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select maxTurnCount, turnCount from t_room where roomID=:roomID';
+			$pa = array(":roomID" => "$rid");
+			$result = $session->query_select($sql, $pa);
+			
+			if (empty($result)){
+				throw new Exception('00200', SYSTEM_ERROR);
+			}
+
+			foreach($result as $row) {
+				$data = $data . $row[0] . SP . $row[1] . RLF;
+			}
+			$data = rtrim($data, RLF);
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			throw new Exception('00002', SYSTEM_ERROR);
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/getUserStatus.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/getUserStatus.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/getUserStatus.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,39 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+		
+			$userid = userIDCheck($_POST['userid']);
+			// $userid = userIDCheck($_GET['userid']);
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select win, lost from t_userStatus where userID = :userID';
+			$pa = array(":userID" => "$userid");
+			$result = $session->query_select($sql, $pa);
+			
+			if (empty($result)) {
+				throw new Exception('00200', SYSTEM_ERROR);
+			}
+			
+			foreach($result as $row) {
+				$data = $data . $row[0] . SP . $row[1] . RLF;
+			}
+			$data = rtrim($data, RLF);
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			if ($e->getCode() == SYSTEM_ERROR) {
+				throw $e;
+			} else {
+				throw new Exception('00002', SYSTEM_ERROR);
+			}
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/getcountry.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/getcountry.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/getcountry.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,27 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select countryID, countryName from t_country';
+			$result = $session->query_select($sql, $pa);
+
+			foreach($result as $row) {
+				$data = $data . $row[0] . SP . $row[1] . RLF;
+			}
+			$data = rtrim($data, RLF);
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			throw new Exception('00002', SYSTEM_ERROR);
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/index.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/index.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/index.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,2 @@
+<?php
+	require('main.php');
\ No newline at end of file

Added: tags/Ver.0.1.5/server/server_php/login.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/login.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/login.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,51 @@
+<?php
+
+	function commandExecute(&$sid) {
+	
+		try {
+		
+			$userid = userIDCheck($_POST['userid']);
+			// $userid = userIDCheck($_GET['userid']);
+			
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+			
+			$sql_id_search = 'select userID from t_user where userID = :userID';
+			$param_id_search = array(":userID" => "$userid");
+			$result_id_search = $session->query_select($sql_id_search, $param_id_search);
+			
+			if (empty($result_id_search)) {
+				// メッセージは仮
+				throw new Exception('08000', SYSTEM_ERROR);
+			}
+			
+			// セッションID?は仮
+			$sessionid = md5(uniqid(rand(),1));			
+			
+			$sql_update_login = 'update t_login set sessionID = :sessionID, lastLoginDate = now(), lastUpdateDate = now() where userID = :userID';
+			$param_update_login = array(":sessionID" => "$sessionid",
+										":userID" => "$userid");
+			$result_update_login = $session->query_update($sql_update_login, $param_update_login);
+			
+			if ($result_update_login <> 1) {
+				// メッセージは仮
+				throw new Exception('09000', SYSTEM_ERROR);
+			}
+			
+			$sid = $sessionid;
+			$data = $userid;
+
+			return $data;
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			if ($e->getCode() == SYSTEM_ERROR) {
+				throw $e;
+			} else {
+				// メッセージは仮
+				throw new Exception('09100', SYSTEM_ERROR);
+			}
+		}
+	}
\ No newline at end of file

Added: tags/Ver.0.1.5/server/server_php/main.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/main.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/main.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,146 @@
+<?php
+
+	require('checkLib.php');
+	require('sysparam.inc');
+	require('dbutil.php');	
+	
+	try {
+
+		$comNo = substr($_POST['data'], 0, 6);
+//		$comNo = substr($_GET['data'], 0, 6);
+
+		$userID = $_POST['userid'];
+		$sessionID = $_POST['sessionid'];
+
+		switch ($comNo) {
+		
+			// 新規ユーザ登録
+			case 'U01001':
+				require('entryNewUser.php');
+				$result = commandExecute($sessionID);
+				break;
+				
+			// 既存ユーザログイン
+			case 'U01002':
+				require('login.php');
+				$result = commandExecute($sessionID);
+				break;
+			
+			// 所属国設定要求
+			case 'C01001':
+				require('');
+				break;
+
+			// 所属国の一覧要求
+			case 'C01002':
+				sessionCheck($comNo, $userID, $sessionID);
+				
+				require('getcountry.php');
+				$result = commandExecute();
+				break;
+
+			// ユーザの初期パラメータ要求
+			case 'U01003':
+				sessionCheck($comNo,$userID, $sessionID);
+			
+				require('getIniUserParam.php');
+				$result = commandExecute();
+				break;
+
+			// ユーザの初期MAP位置設定要求
+			case 'U01004':
+				require('');
+				break;
+
+			// ユーザステータス要求
+			case 'U01005':
+				sessionCheck($comNo, $userID, $sessionID);
+			
+				require('getUserStatus.php');
+				$result = commandExecute();
+				break;
+
+			// AI武将パラメータ要求
+			case 'A01001':
+				sessionCheck($comNo, $userID, $sessionID);
+			
+				require('getAICharParam.php');
+				$result = commandExecute();
+				break;
+
+			// ルーム情報要求
+			case 'R01001':
+				sessionCheck($comNo, $userID, $sessionID);
+			
+				require('getRoomInfo.php');
+				$result = commandExecute();
+				break;
+
+			// ルーム入室要求
+			case 'R01003':
+				sessionCheck($comNo, $userID, $sessionID);
+			
+				require('setUserEntryRoom.php');
+				commandExecute();
+				break;
+
+			// ルーム退室要求
+			case 'R01004':
+				sessionCheck($comNo, $userID, $sessionID);
+			
+				require('setUserExitRoom.php');
+				commandExecute();
+				break;
+
+			// ルームターンカウント要求
+			case 'R01005':
+				sessionCheck($comNo, $userID, $sessionID);
+			
+				require('getRoomTurnCount.php');
+				$result = commandExecute();
+				break;
+
+			// マップ情報要求
+			case 'M01001':
+				sessionCheck($comNo, $userID, $sessionID);
+			
+				require('getMapInfo.php');
+				$result = commandExecute();
+				break;
+
+			// 戦闘情報送信
+			case 'B01001':
+				sessionCheck($comNo, $userID, $sessionID);
+			
+				require('setBattleInfo.php');
+				commandExecute();
+				break;
+
+			// 戦闘結果要求
+			case 'B01002':
+				sessionCheck($comNo, $userID, $sessionID);
+			
+				require('getBattleResult.php');
+				$result = commandExecute();
+				break;
+
+			// コマンドエラー(対応コマンドがない)
+			default:
+				throw new Exception('0000001', SYSTEM_ERROR);
+
+		}
+
+		echo $comNo . SP . CMD_OK . SP . $sessionID .($result ? RLF . $result : "");
+		
+	} catch (sessionException $e) {
+		echo $comNo . SP . CMD_ERR . RLF . SESSION_ERROR;
+	} catch (Exception $e) {
+		if ($e->getCode() == SYSTEM_ERROR) {
+			echo $comNo . SP . CMD_ERR . RLF . $e->getMessage();
+		} else {
+			// 不明なエラー扱い
+			echo $comNo . SP . CMD_ERR . RLF . UNKNOWN_ERROR;
+		}
+	}
+
+?>

Added: tags/Ver.0.1.5/server/server_php/sessionException.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/sessionException.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/sessionException.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,12 @@
+<?php
+
+class sessionException extends Exception {
+
+	public function __construct($message =NULL, $code = 0) {
+
+		parent::__construct($message, $code);
+		
+	}
+	
+}
+

Added: tags/Ver.0.1.5/server/server_php/setBattleInfo.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/setBattleInfo.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/setBattleInfo.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,60 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+			
+			$userid = userIDCheck($_POST['userid']);
+			$roomid = roomIDCheck($_POST['roomid']);
+			$movemapchipno = $_POST['movemapchipno'];
+			$battlecommandid = $_POST['battlecommandid'];
+			$battlemapchipno = $_POST['battlemapchipno'];
+			
+			/*
+			$userid = userIDCheck($_GET['userid']);
+			$roomid = roomIDCheck($_GET['roomid']);
+			$movemapchipno = $_GET['movemapchipno'];
+			$battlecommandid = $_GET['battlecommandid'];
+			$battlemapchipno = $_GET['battlemapchipno'];
+			*/
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+			
+			$sql_user_search = 'select userID, roomID from t_userAction where userID = :userID and roomID = :roomID';
+			$param_user_search = array(":userID" => "$userid",
+										":roomID" => "$roomid");
+			
+			$result_user_search = $session->query_select($sql_user_search, $param_user_search);
+			
+			if (!empty($result_user_search)){
+				// メッセージは仮
+				throw new Exception('02000', SYSTEM_ERROR);
+			}
+			
+			$sql_action_insert = 'insert into t_userAction (userID, roomID, moveMapChipNo, battleCommandID, battleMapChipNo, lastUpdateDate) values (:userid, :roomid, :movemapchipno, :battlecommandid, :battlemapchipno, now())';
+			$param_action_insert = array(":userid" => $userid,
+										 ":roomid" => $roomid,
+										 ":movemapchipno" => $movemapchipno,
+										 ":battlecommandid" => $battlecommandid,
+										 ":battlemapchipno" => $battlemapchipno);
+										 
+			$result_action_insert = $session->query_update($sql_action_insert, $param_action_insert);
+			
+			if ($result_action_insert != 1) {
+				// メッセージは仮
+				throw new Exception('03000', SYSTEM_ERROR);
+			}
+			
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			if ($e->getCode() == SYSTEM_ERROR) {
+				throw $e;
+			} else {
+				throw new Exception('00002', SYSTEM_ERROR);
+			}
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/setUserEntryRoom.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/setUserEntryRoom.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/setUserEntryRoom.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,129 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$uid = userIDCheck($_POST['userid']);
+			$rid = roomIDCheck($_POST['roomid']);
+
+//			$uid = userIDCheck($_GET['userid']);
+//			$rid = roomIDCheck($_GET['roomid']);
+
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'select exclusionKbn from t_battle where userID = :userID and roomID = :roomID';
+			$pa = array(":userID" => "$uid", ":roomID" => "$rid");
+			$result = $session->query_select($sql, $pa);
+
+			if (! empty($result)) {
+				throw new Exception('0080001', SYSTEM_ERROR);
+			}
+
+			//ユーザ情報を取ってくる
+
+			$sql = 'select u.userName, u.country, d.power, d.mobility from t_defaultParam d, t_user u where u.userID = :userID and u.paramID = d.paramID';
+			$pa = array(":userID" => "$uid");
+			$result = $session->query_select($sql, $pa);
+
+			if (empty($result)) {
+				throw new Exception('0080002', SYSTEM_ERROR);
+			} else {
+				foreach($result as $row) {
+					$userName =  $row['userName'];
+					$countryID =  $row['country'];
+					$power = $row['power'];
+					$mobility =  $row['mobility'];
+				}
+			}
+ 
+			$umapNo = getUserMapNo(getUserType($session, $rid, $countryID));
+
+ 			// 乱数なので同じ値にならないことを前提→後で直す
+			$bid = makeBattleID();
+
+			$sql = "insert into t_battle values (:bid, :rid, :uid, :userName, :countryID, :userKbn, :umapNo, :power, :mobility, :exclusionKbn, now())";
+			$pa = array(
+						":bid" => "$bid", 
+						":rid" => "$rid", 
+						":uid" => "$uid", 
+						":userName" => "$userName", 
+						":countryID" => "$countryID", 
+						":userKbn" => USER_KBN, 
+						":umapNo" => "$umapNo", 
+						":power" => "$power", 
+						":mobility" => "$mobility", 
+						":exclusionKbn" => "0");
+
+			$result = $session->query_update($sql, $pa);
+
+			if ($result == 0) {
+				throw new Exception('0080003', SYSTEM_ERROR);
+			}
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			if ($e->getCode() == SYSTEM_ERROR) {
+				throw $e;
+			} else {
+				throw new Exception('00002', SYSTEM_ERROR);
+			}
+		}
+	}
+
+
+	function makeBattleID() {
+
+		$bid = 0;
+
+		for ($i = 0 ; $i < 8 ; $i++){
+			$bid = $bid . mt_rand(0, 9);
+		}
+
+		return $bid;
+	
+	}
+
+
+	function getUserType($s, $roomID, $countryID) {
+	
+		$sql = 'select offenseCountry, defenseCountry from t_room where roomID = :roomID';
+		$pa = array(":roomID" => "$roomID");
+		$result = $s->query_select($sql, $pa);
+
+		if (empty($result)) {
+			throw new Exception('0080004', SYSTEM_ERROR);
+		} else {
+			foreach($result as $row) {
+				$offense =  $row['offenseCountry'];
+				$defense =  $row['defenseCountry'];
+			}
+		}
+		
+		switch ($countryID) {
+			case $offense:
+				$utype = OFF_TYPE;
+				break;
+			case $defense:
+				$utype = DEF_TYPE;
+				break;
+			default :
+				throw new Exception('0080005', SYSTEM_ERROR);
+		}
+		
+		return $utype;
+		
+	}
+
+
+	function getUserMapNo($utype) {
+
+		$initMap = ($utype == OFF_TYPE) ? unserialize(OFF_INIT) : unserialize(DEF_INIT);
+		return $initMap[mt_rand(0, count($initMap))];
+
+	}
+

Added: tags/Ver.0.1.5/server/server_php/setUserExitRoom.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/setUserExitRoom.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/setUserExitRoom.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,36 @@
+<?php
+
+	function commandExecute() {
+
+		try {
+
+			$uid = userIDCheck($_POST['userid']);
+			$rid = roomIDCheck($_POST['roomid']);
+
+//			$uid = userIDCheck($_GET['userid']);
+//			$rid = roomIDCheck($_GET['roomid']);
+
+			$db = new DBConnection();
+			$session = new DBSession($db);
+			$db->AssignDBConnection($session);
+
+			$sql = 'update t_battle set exclusionKbn = 1 where userID = :userID and roomID = :roomID';
+			$pa = array(":userID" => "$uid", ":roomID" => "$rid");
+
+			$result = $session->query_update($sql, $pa);
+
+			if ($result == 0) {
+				throw new Exception('0080001', SYSTEM_ERROR);
+			}
+
+		} catch(PDOException $e){
+			throw new Exception('50000', SYSTEM_ERROR);
+		} catch (Exception $e){ 
+			if ($e->getCode() == SYSTEM_ERROR) {
+				throw $e;
+			} else {
+				throw new Exception('00002', SYSTEM_ERROR);
+			}
+		}
+	}
+

Added: tags/Ver.0.1.5/server/server_php/sysparam.inc
===================================================================
--- tags/Ver.0.1.5/server/server_php/sysparam.inc	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/sysparam.inc	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,150 @@
+<?php
+/**
+ * データベースアクセスに関するパッケージです
+ *
+ * データベースへ接続するパラメータの記述です。
+ * 
+ * @category   system
+ * @package    sysutil
+ * @author     okotaneko
+ * @version    1.0
+ * @access     public
+ */
+
+/**
+ * ここは inlcude DocBlock です。
+ *
+ * inlcude ファイルの説明など書きます。
+ */
+
+/**
+ * 三国志システムエラー(クライアントにエラーを返す)
+ * (本当はException継承して独自エラーを作成するのだが・・・)
+ * 例外のcatchのgetCode以外で仕様しないこと
+ * 
+ * @var string 三国志システムが独自に使用するエラーコード
+ */
+define('SYSTEM_ERROR', 99);
+
+/**
+ * 不明なエラーコード
+ * 
+ * @var string システムが生成した例外以外のエラーコード
+ */
+define('UNKNOWN_ERROR', 99999);
+
+/**
+ * 不明なエラーコード
+ * 
+ * @var string セッションID不一致のエラーコード
+ */
+define('SESSION_ERROR', 999);
+
+/**
+ * コマンド成功値
+ * 
+ * @var integer コマンド失敗時の値
+ */
+define('CMD_ERR', 1);
+
+/**
+ * コマンド成功値
+ * 
+ * @var integer コマンド成功時の値
+ */
+define('CMD_OK', 0);
+
+
+/**
+ * 電文のセパレータ文字
+ * 
+ * @var string セパレータの文字
+ */
+define('SP', ',');
+
+/**
+ * 電文のラインフィード
+ * 
+ * @var string セパレータの文字
+ */
+define('RLF', '>>');
+
+/**
+ * UserIDの桁数
+ * 
+ * @var integer UserIDの桁数
+ */
+define('USERID_CNT', 10);
+
+/**
+ * UserIDの型(先頭文字)
+ * 
+ * @var integer UserIDの型(先頭文字)
+ */
+define('USERID_PREFIX', 'U');
+
+/**
+ * UserNameの桁数
+ *
+ * @var integer UserNameの桁数
+ *
+ */
+define('USERNAME_CNT', 40);
+
+/**
+ * UserTypeの区分
+ * 
+ * @var string UserIDの区分文字
+ */
+define('USER_KBN', 'u');
+
+/**
+ * UserTypeの区分
+ * 
+ * @var string 総大将の区分文字
+ */
+define('SOUDAISYO_KBN', 's');
+
+/**
+ * 受付時間終了フラグ
+ * 
+ * @var integer 受付時間が終了した時のフラグ値
+ */
+define('OVERTIME', 1);
+
+/**
+ * 攻撃側判定フラグ
+ * 
+ * @var integer 攻撃側判定フラグ
+ */
+define('OFF_TYPE', 1);
+
+/**
+ * 守備側判定フラグ
+ * 
+ * @var integer 守備側判定フラグ
+ */
+define('DEF_TYPE', 2);
+
+/**
+ * 攻撃側初期位置配列
+ * 
+ * @var integer 攻撃側初期配備位置
+ */
+define('OFF_INIT', serialize(array(3356,3357,3358,3359,3360,3416,3417,3418,3419,3420,3476,3477,3478,3479,3480,3536,3537,3538,3539,3540,3596,3597,3598,3599,3600)));
+
+/**
+ * 守備側初期位置配列
+ * 
+ * @var integer 守備側初期配備位置
+ */
+define('DEF_INIT', serialize(array(1,2,3,4,5,61,62,63,64,65,121,122,123,124,125,181,182,183,184,185,241,242,243,244,245,3301,3302,3303,3304,3305,3361,3362,3363,3364,3365,3421,3422,3423,3424,3425,3481,3482,3483,3484,3485,3541,3542,3543,3544,3545)));
+
+/**
+ * 攻撃減算地
+ * 
+ * @var integer 守備側判定フラグ
+ */
+define('DEC_POWER', 10);
+
+

Added: tags/Ver.0.1.5/server/server_php/table_t_login.txt
===================================================================
--- tags/Ver.0.1.5/server/server_php/table_t_login.txt	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/table_t_login.txt	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,8 @@
+CREATE  TABLE IF NOT EXISTS `o_sangokushi`.`t_login` (
+  `userID` VARCHAR(10) NOT NULL ,
+  `sessionID` VARCHAR(40) NOT NULL ,
+  `lastLoginDate` DATETIME NULL,
+  `lastUpdateDate` DATETIME NULL ,
+  PRIMARY KEY (`userID`) )
+ENGINE = InnoDB
+DEFAULT CHARACTER SET = utf8
\ No newline at end of file

Added: tags/Ver.0.1.5/server/server_php/turntimer.php
===================================================================
--- tags/Ver.0.1.5/server/server_php/turntimer.php	                        (rev 0)
+++ tags/Ver.0.1.5/server/server_php/turntimer.php	2010-11-05 15:44:59 UTC (rev 459)
@@ -0,0 +1,333 @@
+<?php
+
+	require('dbutil.php');
+	require('sysparam.inc');
+
+	try {
+
+		$db = new DBConnection();
+		$session = new DBSession($db);
+		$db->AssignDBConnection($session);
+
+		$sql = 'select roomID, receiptTime, turnInterval, gameInterval, timerStatus, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > turnInterval, 1, 0) as timeover, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > gameInterval, 1, 0) as gamestart from t_turnTimer where roomID = 1';
+		$sql .= ' union select roomID, receiptTime, turnInterval, gameInterval, timerStatus, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > turnInterval, 1, 0) as timeover, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > gameInterval, 1, 0) as gamestart from t_turnTimer where roomID = 2';
+		$sql .= ' union select roomID, receiptTime, turnInterval, gameInterval, timerStatus, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > turnInterval, 1, 0) as timeover, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > gameInterval, 1, 0) as gamestart from t_turnTimer where roomID = 3';
+		$sql .= ' union select roomID, receiptTime, turnInterval, gameInterval, timerStatus, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > turnInterval, 1, 0) as timeover, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > gameInterval, 1, 0) as gamestart from t_turnTimer where roomID = 4';
+		$sql .= ' union select roomID, receiptTime, turnInterval, gameInterval, timerStatus, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > turnInterval, 1, 0) as timeover, if(sum(unix_timestamp(now())-unix_timestamp(receiptTime)) > gameInterval, 1, 0) as gamestart from t_turnTimer where roomID = 5';
+
+		$result = $session->query_select($sql, $pa);
+
+		if (empty($result)) {
+			throw new Exception('00502', SYSTEM_ERROR);
+		} else {
+			foreach($result as $row) {
+				$rid =  $row['roomID'];
+				$rtime =  $row['receiptTime'];
+				$tinterval =  $row['turnInterval'];
+				$ginterval =  $row['gameInterval'];
+				$tstatus = $row['timerStatus'];
+				$tover = $row['timeover'];
+				$gstart = $row['gamestart'];
+
+				switch($tstatus){
+					case 0 :
+//						if ($gstart == OVERTIME) {
+							if (checkUser($session, $rid)){
+
+//								setNewGameReset($session, $rid);
+//								setNewTurnReset($session, $rid);
+//								setNewReceipt($session, 0, $rid);
+//								clsRoomTurnCount($session,$rid);
+//								roomRrecruit($session, $rid, 2);
+								// 次のAIを決める
+//								setAIchar($session, $rid);
+							} else {
+								setNewReceipt($session, 3, $rid);
+							}
+//						}
+						break;
+					case 1 :
+						// 受付
+						if ($tover == OVERTIME) {
+
+							// 受付を終了フラグをたてる
+							changeStatus($session, 2, $rid);
+
+							// 更新中のデータがあるかもしれないので念のため少し待機
+							sleep(5);
+
+							// 計算ロジックを実行する 
+							if (battlecalculate($session, $rid)) {
+								// 次のゲーム開始状態にする
+								setNewTurnReset($session, $rid);
+								setNewReceipt($session, 4, $rid);
+
+								// 一旦募集はやらない
+								roomRrecruit($session, $rid, 1);
+							} else {
+								setNewTurnReset($session,$rid);
+
+//								require('AI.php');
+//								aiAction($rid);
+
+								addRoomTurnCount($session,$rid);
+								// 新しい時間をセットする 受付中にする
+								setNewReceipt($session, 1, $rid);
+							}
+						}
+						break;
+					case 3 :
+						if ($gstart == OVERTIME) {
+							setNewReceipt($session, 1, $rid);
+						}
+
+						break;
+					case 4 :
+						if ($gstart == OVERTIME) {
+							setNewGameReset($session, $rid);
+							setNewTurnReset($session, $rid);
+							roomRrecruit($session, $rid, 2);
+							clsRoomTurnCount($session,$rid);
+							setAIchar($session, $rid);
+
+							setNewReceipt($session, 0, $rid);
+						}
+						break;
+
+					default:
+				
+				}
+
+			}
+		}
+
+
+	} catch(PDOException $e){
+		throw new Exception('50000', SYSTEM_ERROR);
+	} catch (Exception $e){ 
+		throw new Exception('00002', SYSTEM_ERROR);
+	}
+
+	function checkUser($session, $rid) {
+
+		$sql = "select battleID from t_battle where roomID = :roomID and charKbn = '" . USER_KBN ."'";
+		$pa = array(":roomID" => $rid);
+		$result = $session->query_update($sql, $pa);
+
+		return empty($result);
+
+	}
+
+	function changeStatus($session, $status, $rid) {
+
+		$sql = "update t_turnTimer set timerStatus = :status where roomID = :roomID";
+		$pa = array(":status" => $status, ":roomID" => $rid);
+
+		$result = $session->query_update($sql, $pa);
+
+		if ($result == 0) {
+			throw new Exception('0090001', SYSTEM_ERROR);
+		}
+
+	}
+
+	function setNewReceipt($session, $status, $rid) {
+
+		$sql = "update t_turnTimer set receiptTime = now(), timerStatus = :status where roomID = :roomID";
+		$pa = array(":status" => $status, ":roomID" => $rid);
+
+		$result = $session->query_update($sql, $pa);
+
+		if ($result == 0) {
+			throw new Exception('0090002', SYSTEM_ERROR);
+		}
+
+	}
+
+	function setNewTurnReset($session, $rid) {
+
+		$sql = "delete from t_userAction where roomID = :roomID";
+		$pa = array(":roomID" => "$rid");
+
+		$result = $session->query_update($sql, $pa);
+
+	}
+
+	function setNewGameReset($session, $rid) {
+
+		$sql = "delete from t_battle where roomID = :roomID";
+		$pa = array(":roomID" => "$rid" );
+
+		$result = $session->query_update($sql, $pa);
+
+	}
+
+	function roomRrecruit($session, $rid, $recruit) {
+
+		$sql = 'update t_room set roomStatus = :roomStatus, lastUpdateDate = now() where roomID = :roomID';
+		$pa = array( ":roomStatus" => $recruit, ":roomID" => $rid);
+		$result_uid = $session->query_select($sql, $pa);
+
+	}
+
+	function addRoomTurnCount($session, $rid) {
+
+		$sql = 'update t_room set turnCount = turnCount + 1, lastUpdateDate = now() where roomID = :roomID';
+		$pa = array(":roomID" => $rid);
+		$result_uid = $session->query_select($sql, $pa);
+
+	}
+
+	function clsRoomTurnCount($session, $rid) {
+
+		$sql = 'update t_room set turnCount = 0, lastUpdateDate = now() where roomID = :roomID';
+		$pa = array(":roomID" => $rid);
+		$result_uid = $session->query_select($sql, $pa);
+
+	}
+
+	function battlecalculate($session, $rid) {
+
+		$gameOver = false;
+
+		$sql = 'select userID, roomID, moveMapChipNo, battleCommandID, battleMapChipNo from t_userAction where roomId = :roomID';
+		$pa = array(":roomID" =>  $rid);
+		$result = $session->query_select($sql, $pa);
+
+		if (! empty($result)) {
+			foreach($result as $row) {
+				if (! empty($row['battleMapChipNo'])) {
+					$sql = 'update t_battle set power=power - :dp where mapChipNo = :bMapchip and roomID = :roomID';
+					$pa = array( ":dp" => DEC_POWER, ":bMapchip" => $row['battleMapChipNo'], ":roomID" => $rid);
+
+					$result_uid = $session->query_select($sql, $pa);
+				}
+			}
+
+			foreach($result as $row) {
+				if (! empty($row['moveMapChipNo'])) {
+					$sql = 'update t_battle set mapChipNo = :mapChipNo where userID = :userID and roomID = :roomID';
+					$pa = array( ":mapChipNo" => $row['moveMapChipNo'], ":userID" => $row['userID'], ":roomID" => $rid);
+					$result_uid = $session->query_select($sql, $pa);
+				}
+			}
+
+			//終了確認(全部をunion結合して判定は一回でもいいような)
+
+			// 総大将やられた
+			$sql = 'select battleID from t_battle where charKbn = :soudaisyo and roomID = :roomID and power = 0';
+			$pa = array( ":soudaisyo" => SOUDAISYO_KBN, ":roomID" => $rid);
+
+			$result = $session->query_select($sql, $pa);
+			if (! empty($result)) {
+				$gameOver = true;
+			}
+
+			//兵力0
+			$sql = 'select power_a from (select countryID, sum(power) as power_a from t_battle where roomID = :roomID group by countryID) a where power_a = 0';
+			$pa = array(":roomID" => $rid);
+
+			$result = $session->query_select($sql, $pa);
+			if (! empty($result)) {
+				$gameOver = true;
+			}
+		}
+
+		// ルームテーブルのカウンター値
+		$sql = 'select roomID from t_room where roomID = :roomID and maxTurnCount < turnCount';
+		$pa = array(":roomID" => $rid);
+
+		$result = $session->query_select($sql, $pa);
+		if (! empty($result)) {
+			$gameOver = true;
+		}
+
+		return $gameOver;
+
+	}
+
+
+	function setAiChar($session, $rid) {
+	
+
+		$sql = 'select offenseCountry, defenseCountry from t_room where roomID = :roomID';
+		$pa = array(":roomID" => $rid);
+
+		$result = $session->query_select($sql, $pa);
+		foreach($result as $row) {
+			setAiBattle($session, $row['offenseCountry'], OFF_TYPE, $rid);
+			setAiBattle($session, $row['defenseCountry'], DEF_TYPE, $rid);
+		}
+	}
+
+
+	function setAiBattle($session, $countryID, $type, $rid){
+
+		$sql = 'select a.charID, a.charName, a.countryID, a.charType, d.power, d.mobility from t_defaultParam d, t_AICharacter a where a.countryID = :countryID and a.paramID = d.paramID';
+		$pa = array(":countryID" => $countryID);
+
+		$result = $session->query_select($sql, $pa);
+		$randkey = range(0, count($result) - 1);
+		shuffle($randkey);
+
+		$numOfChars = min(array(3, count($result)));
+		
+		$ctype = false;
+		$cnt = 0;
+		for ($c = 0; $c < $numOfChars; $c++ ) {
+			$row = $result[$randkey[$c]];
+			$cnt++;
+
+			if ($row['charType'] == SOUDAISYO_KBN) {
+				$ctype = true;
+			}
+
+			if ($cnt == $numOfChars and $ctype == false) {
+				$row['charType'] = SOUDAISYO_KBN;
+			}
+
+			$umapNo = getUserMapNo($type);
+	
+ 			// 乱数なので同じ値にならないことを前提→後で直す
+			$bid = makeBattleID();
+
+			$sql = "insert into t_battle values (:bid, :rid, :uid, :userName, :countryID, :userKbn, :umapNo, :power, :mobility, :exclusionKbn, now())";
+			$pa = array(
+						":bid" => "$bid", 
+						":rid" => "$rid", 
+						":uid" => $row['charID'], 
+						":userName" => $row['charName'], 
+						":countryID" => $row['countryID'], 
+						":userKbn" => $row['charType'], 
+						":umapNo" => "$umapNo", 
+						":power" => $row['power'], 
+						":mobility" => $row['mobility'], 
+						":exclusionKbn" => "0");
+
+			$result_inc = $session->query_update($sql, $pa);
+
+			if ($result_inc == 0) {
+				throw new Exception('0080003', SYSTEM_ERROR);
+			}
+		}
+	}
+
+	function makeBattleID() {
+
+		$bid = 0;
+
+		for ($i = 0 ; $i < 8 ; $i++){
+			$bid = $bid . mt_rand(0, 9);
+		}
+
+		return $bid;
+	
+	}
+
+	function getUserMapNo($utype) {
+
+		$initMap = ($utype == OFF_TYPE) ? unserialize(OFF_INIT) : unserialize(DEF_INIT);
+		return $initMap[mt_rand(0, count($initMap))];
+	}
+
+

Added: tags/Ver.0.1.5/server/三国志サーバインストール手順_CentOS5_32.txt
===================================================================
(Binary files differ)


Property changes on: tags/Ver.0.1.5/server/三国志サーバインストール手順_CentOS5_32.txt
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: tags/Ver.0.1.5/server/三国志サーバインストール手順_CentOS5_64.txt
===================================================================
(Binary files differ)


Property changes on: tags/Ver.0.1.5/server/三国志サーバインストール手順_CentOS5_64.txt
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: tags/Ver.0.1.5/server.ver.0.1.5.tar.gz
===================================================================
(Binary files differ)


Property changes on: tags/Ver.0.1.5/server.ver.0.1.5.tar.gz
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream




Sangokushi-svn メーリングリストの案内