OSDN Git Service

Stub files connecting to a shogigraphic server.
authorbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Fri, 2 Jan 2009 02:27:47 +0000 (02:27 +0000)
committerbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Fri, 2 Jan 2009 02:27:47 +0000 (02:27 +0000)
showgame/README [new file with mode: 0644]
showgame/gen-rb/ShogiGraphic.rb [new file with mode: 0644]
showgame/gen-rb/graphicserver_constants.rb [new file with mode: 0644]
showgame/gen-rb/graphicserver_types.rb [new file with mode: 0644]

diff --git a/showgame/README b/showgame/README
new file mode 100644 (file)
index 0000000..0b3abcc
--- /dev/null
@@ -0,0 +1,11 @@
+Start a thrift server
+
+  $ ./graphicserver --port 9090 -d ./public/images
+
+Start a Webrick server
+
+  $ ./start.rb
+
+Browser
+
+  http://localhost:7000/game/hoge+testJishogiTest-1500-0+senteJishogiTest+goteJishogiTest+20081125125336.csa
diff --git a/showgame/gen-rb/ShogiGraphic.rb b/showgame/gen-rb/ShogiGraphic.rb
new file mode 100644 (file)
index 0000000..c436f04
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+require 'thrift'
+require 'thrift/protocol'
+require File.dirname(__FILE__) + '/graphicserver_types'
+
+module ShogiGraphic
+  class Client
+    include Thrift::Client
+
+    def usi2png(usi)
+      send_usi2png(usi)
+      return recv_usi2png()
+    end
+
+    def send_usi2png(usi)
+      send_message('usi2png', Usi2png_args, :usi => usi)
+    end
+
+    def recv_usi2png()
+      result = receive_message(Usi2png_result)
+      return result.success unless result.success.nil?
+      raise Thrift::ApplicationException.new(Thrift::ApplicationException::MISSING_RESULT, 'usi2png failed: unknown result')
+    end
+
+  end
+
+  class Processor
+    include Thrift::Processor
+
+    def process_usi2png(seqid, iprot, oprot)
+      args = read_args(iprot, Usi2png_args)
+      result = Usi2png_result.new()
+      result.success = @handler.usi2png(args.usi)
+      write_result(result, oprot, 'usi2png', seqid)
+    end
+
+  end
+
+  # HELPER FUNCTIONS AND STRUCTURES
+
+  class Usi2png_args
+    include Thrift::Struct
+    Thrift::Struct.field_accessor self, :usi
+    FIELDS = {
+      1 => {:type => Thrift::Types::STRING, :name => 'usi'}
+    }
+  end
+
+  class Usi2png_result
+    include Thrift::Struct
+    Thrift::Struct.field_accessor self, :success
+    FIELDS = {
+      0 => {:type => Thrift::Types::STRING, :name => 'success'}
+    }
+  end
+
+end
+
diff --git a/showgame/gen-rb/graphicserver_constants.rb b/showgame/gen-rb/graphicserver_constants.rb
new file mode 100644 (file)
index 0000000..fe6dbfa
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+require 'thrift/protocol'
+require File.dirname(__FILE__) + '/graphicserver_types'
+
diff --git a/showgame/gen-rb/graphicserver_types.rb b/showgame/gen-rb/graphicserver_types.rb
new file mode 100644 (file)
index 0000000..538802f
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+require 'thrift/protocol'
+